ProgrammingHardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(max(3, 7, key=lambda v: -v), min('a', 'B'))
  1. A. 3 B
  2. B. 7 B
  3. C. 3 a
  4. D. 7 a

Correct answer: A. 3 B

With key -v, the largest key belongs to 3, since -3 > -7. min compares code points, and B (66) is smaller than a (97).

More Python Programming questions

Exams that ask this topic