ProgrammingHardTCS NQT · Wipro pattern

What is printed?

What is printed?
print('aaa' < 'b', 'abc' > 'abd')
  1. A. True True
  2. B. False False
  3. C. False True
  4. D. True False

Correct answer: D. True False

Strings compare character by character, and a in aaa is smaller than b. abc is smaller than abd because c comes before d.

More Python Programming questions

Exams that ask this topic