ProgrammingModerateTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print('abc' < 'abcd', 'Z' < 'a', '10' < '9')
  1. A. False True True
  2. B. True True False
  3. C. True True True
  4. D. True False True

Correct answer: C. True True True

A prefix is smaller than the longer string. Uppercase Z (90) is below lowercase a (97). '1' comes before '9', so '10' is less than '9'.

More Python Programming questions

Exams that ask this topic