7 Answers
New AnswerHi ! I'm doing the Python course on the operators and the booleans. I was specificly learning the operator - precedence. I don't understand why it returns False. In fact, "(True or False)" can be False and match with the "==". So why is it everytime False ? I would be nice to explain me where does my reasonning fail :) Thank you in advance ! Koast
2/26/2018 6:28:24 PM
Koast7 Answers
New AnswerThanks a lot maxcookmax ! The point i didn't get was that "(False or True)" returns True each time there is a True in the instruction. Koast
Happy to help! What I think the reason why is because true (1) and false (0) are one byte. 1 is on 0 is off, no electricity flows when its 0, or false, so a true is worth more. Hopefully that makes sense lol
Try to run this code i.e, print(False or True) you will get the output : True and then evaluate the expression print(False==True) ultimately the output will be False. Hope you find it helpful. Thank you :-)
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message