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 228 views
4 answers 278 views
1 answer 179 views
179 views asked Jan 12, 2021 by avibootz
2 answers 213 views
1 answer 193 views
...