+ 1
What happens if you write ==?
2 Réponses
+ 4
Tim Steiner
It checks if 2 things are equivalent to each other.
For example:
5 == 5
>>> True
10 == 9
>>> False
+ 2
== is a comparison operator.
It is like any arithmetic (+, -, /, ...) operator, but it always returns a boolean (either True or False).
== in words means "is equal to"
4 == 3: "4 is equal to 3": False
2 == 2: "2 is equal to 2": True