Question

Predict the output for below code in python

X=true

Y=false

Z=false

if not X or Y :

print(“first case”)

elif not X or Y or not Y and X

print(“second case”)

else :

print(“no case”)

A first case Correct Answer Incorrect Answer
B second case Correct Answer Incorrect Answer
C no case Correct Answer Incorrect Answer
D second case no case Correct Answer Incorrect Answer
E error Correct Answer Incorrect Answer

Solution

first priority goes to not, then and then or operations in python,

Practice Next
×
×