Question 10
Back to Exercise
What is the output of the following Python program?
print("apple" < "Apple", "10" < "9", "abc" < "abd", "Zebra" < "apple", "ab" < "abc")
- A False True True True True Correct
- B True False True False True
- C False False True True False
- D False True False True True
Correct Answer: Option A
Comparison is character by character by code point: "a" (97) > "A" (65); "1" < "9", so "10" < "9"; a prefix is smaller than the longer string.
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!