- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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