==
equal >
greater than <
smaller than !=
not equal >=
greater than or equal to <=
smaller than or equal to1==1
is same as asking Python this question: Is 1 equal to 1”? (The answer is yes.) The result of these comparison is a data type called Boolean, which has only two possible values: True
or False
.==
and =
are not the same.
==
is used for comparison, while =
is used for assigning a value to a variable.