Answers for "python find max tuple in list based on a value in it"

0

python max value of list of tuples

In [53]: lis=[(101, 153), (255, 827), (361, 961)]

In [81]: from operator import itemgetter

In [82]: max(lis,key=itemgetter(1))[0]    #faster solution
Out[82]: 361
Posted by: Guest on May-20-2021
7

find max value in list python

mylist = [1, 7, 3, 12, 5]

min_value = min(mylist)
max_value = max(mylist)
Posted by: Guest on April-22-2021

Code answers related to "python find max tuple in list based on a value in it"

Python Answers by Framework

Browse Popular Code Answers by Language