ProgrammingModerateTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(max('apple', 'banana', key=len), max([], default=None))
  1. A. banana None
  2. B. apple None
  3. C. banana []
  4. D. banana 0

Correct answer: A. banana None

The key len makes banana (6 letters) the longest word. max of an empty iterable returns the default None.

More Python Programming questions

Exams that ask this topic