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?

23rd Feb 2020, 12:41 PM
Jatin
2 Respuestas
+ 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
23rd Feb 2020, 12:47 PM
Utkarsh Sharma
Utkarsh Sharma - avatar
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)
23rd Feb 2020, 12:54 PM
Trần Tân An Nguyễn
Trần Tân An Nguyễn - avatar