ProgrammingModerateTCS NQT · Wipro pattern

What is printed?

What is printed?
print(max(['bb', 'aa', 'c'], key=len), min(['bb', 'aa', 'c'], key=len))
  1. A. bb c
  2. B. aa c
  3. C. c bb
  4. D. bb bb

Correct answer: A. bb c

max and min return the first element among equal keys. bb is the first of the two longest words, and c is the only shortest word.

More Python Programming questions

Exams that ask this topic