+ 1
Can someone explain the uses or meaning of == operator?
4 ответов
+ 2
I am also a beginner, but as far as I'm concerned, it is used to know if two objects are equal or not. Depending on the case, the output would be the logical answers: True or False.
+ 2
== is comparator, = assignment
+ 2
own yeah a comparator now i get it thanks dude
+ 1
Suppose
Assignment Operator
x = 1
print x
Ans : 1
Comparison Operator
x = 2
y = 3
if x == y
print "not comparison operation"
else
print "comparison operation"
Ans : In this case x and y are not same so it will give else print statement
x = 3
y = 3
if x == y
print 1
else
print 0
Ans : in this case x and y are same so it will give if condition print statement