Question 14
Back to Exercise
What is the output of the following Python program?
print([1, 2] == [2, 1], [1, 2, 3] < [1, 3], [] < [0], [2] > [1, 9, 9])
- A True True True False
- B False False True False
- C False True True True Correct
- D False True False True
Correct Answer: Option C
Lists compare item by item: order matters for ==; 2 < 3 decides [1, 2, 3] < [1, 3]; an empty list is smaller than any non-empty one; 2 > 1 decides the last.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!