Q. What is the output of the following code?
Code:
x = True
y = False
z = False
if not x or y:
print 10
elif not x or not y and z:
print 20
elif not x or y or not y and z:
print 30
else:
print 40
β
Correct Answer: (D)
40
Explanation: In Python, the order of priority is first NOT, then AND and finally OR.