+ 2
Can anyone explain the how the output of print(false==(false or true)) is false??
3 Answers
+ 7
false==(false or true)
Consider the inner statement "(false or true)". this will evaluate to "true" because " 1 or 0" is 1, i.e., true.
Now,
false==(false or true) translates to (false==true)
and that is false since false cant be true.
So answer is false.
+ 1
operator-precedence
first,
(false or true)
it's true
second,
false==true
obviously,it's false
so,answer is false!
0
code: (False == (False or True))
translation: Is False equal to (False or True)?
#False or True is always True because 'or' operator needs only one of the values to be True
#unlike 'and' operator who needs all values to be True (False and True == True)
Is False equal to True? --> False