ProgrammingModerateTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(max(range(10), key=lambda x: x % 4), min([], default=7))
  1. A. 9 7
  2. B. 3 7
  3. C. 7 7
  4. D. 3 0

Correct answer: B. 3 7

The largest remainder mod 4 is 3, reached first at x = 3. min of an empty iterable returns the default 7.

More Python Programming questions

Exams that ask this topic