+ 1

‘Boolean Not is equal to !=‘?

Anyone has the same idea for this question? See below Please. Line 1 & Line 3 are False. print(not 1 == 1) print(not 1 > 7) print(1!=1)

31st Oct 2019, 12:37 PM
Storm Yule
Storm Yule - avatar
3 Respostas
+ 6
What do you not understand ? 1. 1==1 outputs True, so not(1==1) will output False 2. Same concept 3. != tests if two things have different values, the statement tests if 1 is not equal to 1, since they're equal, the output is again False
31st Oct 2019, 12:48 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 5
not this is a negation while ==, !=, >= etc are the comparisons of 2 values‼️🤔
31st Oct 2019, 6:30 PM
Janusz Bujak 🇵🇱
Janusz Bujak 🇵🇱 - avatar
+ 1
No, != and not are not the same. not is used to negate a boolean, while != is used to compare 2 values as not equal. not x is used to convert x to True, when x is False, and False, when x is True. x != y is True, when x is not equal to y, otherwise False. not x == y would equal x != y, but in place of x == y there would be any kinds of comparisons, even comparisons, that don't have second operand y, like x != y does.
31st Oct 2019, 3:39 PM
Seb TheS
Seb TheS - avatar