+ 1

What does == mean ?

1st Jul 2019, 12:50 PM
Pranav Choudhary
Pranav Choudhary - avatar
4 ответов
+ 1
It is a comparison operator. It returns true, if both values are the same, otherwise false Example: 5 == 5 //true 5 == 4 //false 5 == "5" //true, works for different datatypes
1st Jul 2019, 12:52 PM
Airree
Airree - avatar
+ 2
Sure, but he didn't say a word about languages
1st Jul 2019, 12:58 PM
Airree
Airree - avatar
+ 2
In Python 5 == "5" is False. == is used to check, whether 2 compared values have the equal value and returns a boolean (True or False). == in words: "is equal to".
2nd Jul 2019, 10:05 AM
Seb TheS
Seb TheS - avatar
0
Airree for the last example, I don't agree. In some langages, like JS, you're right but in python, it returns False.
1st Jul 2019, 12:54 PM
Théophile
Théophile - avatar