Q:

Write a Python program to find a tuple, the smallest second index value from a list of tuples

0

Write a Python program to find a tuple, the smallest second index value from a list of tuples.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

x = [(4, 1), (1, 2), (6, 0)]
print(min(x, key=lambda n: (n[1], -n[0])))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now