ProgrammingModerateProduct-company MCQ pattern

What is printed?

What is printed?
print(max("apple", "Banana", "cherry"))
  1. A. TypeError
  2. B. cherry
  3. C. apple
  4. D. Banana

Correct answer: B. cherry

Strings compare by Unicode code point, character by character. Every uppercase letter (A–Z, 65–90) sorts before every lowercase letter (97–122), so "Banana" is the smallest and "cherry" ('c' > 'a') is the largest.

More Python Programming questions

Exams that ask this topic