ProgrammingHardTCS NQT · Infosys

What is printed?

What is printed?
print(max('zebra', 'Zebra'), min('zebra', 'Zebra'), 'apple' > 'Apple', 'Z' < 'a')
  1. A. zebra zebra True False
  2. B. zebra Zebra True True
  3. C. Zebra zebra False True
  4. D. zebra Zebra False False

Correct answer: B. zebra Zebra True True

Lowercase letters have larger code points than uppercase, so zebra beats Zebra in both max and min. Comparing apple with Apple is decided by the first character, and Z (90) is less than a (97).

More Python Programming questions

Exams that ask this topic