MCQ Hive stays free thanks to ads. Please disable your ad blocker for this site so content and features keep working.
Fundamental Programming
Operators & Expressions
Beginner
Q
What does print(0 or "" or [] or "end", 3 and 0) output in Python?
Aend False
Bend 0
C[] 0
DTrue False
Correct Answer:
B. end 0
Explanation:
and and or return one of their operands, not a bool. or returns the first truthy operand. and returns the first falsy operand, or the last operand if all are truthy.
ALSO KNOW (related points):
• What does print(1 < 3 > 2) output in Python? → True
• What does print(not 1 == 2) output in Python? → True