0
Print((True or False) and False) ???????
Print(True or False and False) Print((True or False) and False)) Print(True and False or True) Can anyone explain me,,,,,,,,line 2 - why the output is false?
2 ответов
+ 2
For the first
print (True or False and False)
False and False == True
print(True or True)
O/P -- True
For 2nd the True or False in brackets is prioritised
print((True or False) and False)
between True or false, it will select true always...
print(True and False)
which is False
For 3rd
print(True and False or True)
True and False == False
print(False or True)
Again between False or True it will print True
0
1. True or False and False = True and False = False (from left to right)
2. (True or False) and False -> Just like 1.
3. True and False or True = False or True = True (from left to right)