Print((True or False) and False) ??????? | SoloLearn: Learn to code for FREE!

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/23/2020 12:41:22 PM

Jatin

2 Answers

New Answer

+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)