Questions

What is the Function of == in Python?

The “==” operator is known as the equality operator. The operator will return “true” if both the operands are equal. However, it should not be confused with the “=” operator or the “is” operator. “=” works as an assignment operator. It assigns values to the variables. On the other hand, the “is” operator in Python verifies whether the two variables point to the same object in the memory. In general, programmers use “==” and “!=” operators to compare values.

Suppose, x=1

y=2

z=2

(x==y) will return false as both are assigned different values. (y==z) will return true as both are assigned the same values.

Related Questions

Related Topics

Share with friends

Customize your course in 30 seconds

Which class are you in?
5th
6th
7th
8th
9th
10th
11th
12th
Get ready for all-new Live Classes!
Now learn Live with India's best teachers. Join courses with the best schedule and enjoy fun and interactive classes.
tutor
tutor
Ashhar Firdausi
IIT Roorkee
Biology
tutor
tutor
Dr. Nazma Shaik
VTU
Chemistry
tutor
tutor
Gaurav Tiwari
APJAKTU
Physics
Get Started

Leave a Reply

Your email address will not be published. Required fields are marked *

Download the App

Watch lectures, practise questions and take tests on the go.

Customize your course in 30 seconds

No thanks.