Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Finding The Biggest Key In A Python Dictionary?
If you have a dict with string-integer mappings, you can use the max method on the dictionary's item pairs to get the largest value.
example
d = {
'foo': 100,
'bar': 25,
'baz': 360
}
print(max(k for k, v in d.items()))
Output
This will give the output −
foo
foo is largest in alphabetical order.
Advertisements
