How to find item in a dictionary with maximum value in Python

1 Answer

0 votes
dic = {'java':34, 'python':522, 'php':726, 'c':8726, 'c#':4, 'c++':7}
 
result = max(dic.items(), key=lambda i: i[1])

print(result)



'''
run:

('c', 8726)

'''

 



answered Feb 2, 2020 by avibootz

Related questions

2 answers 357 views
4 answers 450 views
1 answer 272 views
272 views asked Jan 12, 2021 by avibootz
2 answers 323 views
1 answer 295 views
...