ProgrammingHardTCS CodeVita · Infosys HackWithInfy
What is printed?
What is printed?
print(max(3, 7, key=lambda v: -v), min('a', 'B'))- A. 3 B
- B. 7 B
- C. 3 a
- 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
- What is printed? python print(str(True) + str(1 == 1.0), type(True + True).name)
- What is printed? python print(round(-0.5), round(0.5), round(1.5), round(-1.5))
- What is printed? python import bisect print(bisect.bisectright([1, 2, 2, 3], 2, lo=2))
- What is printed? python print(2 3 0, (2 3) 0)
- What is printed? python print(7 & 3 | 4 ^ 1)
- What is printed? python print(5 <= 5 < 6 != 7, 1 < 2 > 3)