list_1 = [(2, 0), (1, 1), (3, 2), (2, 3)]
temp = list_1[0][0]
if temp < max(list_1):
I want to make sure that the values from the two-dimensional list are the highest values in this list
Since it is a two-dimensional list, if you use max, the triple is returned, so it cannot be compared with the int value.
Is there a way to know max among list_1[*][1]
(the first value among all tuples in the list)?
>>> list_1 = [(2, 10), (1, 11), (3, 12), (2, 13)]
>>> max_0th = max(t[0] for t in list_1)
>>> max_0th
3
>>> max_1th = max(t[1] for t in list_1)
>>> max_1th
13
>>>
© 2024 OneMinuteCode. All rights reserved.