We can use operator.itemgetter
import operator
stats = {'Dave':179, 'Adam':180, 'Daniel': 170}
max(stats.items(), key=operator.itemgetter(1))
More Related Contents:
- What are () (parentheses) are for in regex python [duplicate]
- Why can a function modify some arguments as perceived by the caller, but not others?
- Why does the expression 0 < 0 == 0 return False in Python?
- how to sort pandas dataframe from one column
- Nested List Indices [duplicate]
- Getting a hidden password input
- Django auto_now and auto_now_add
- Python function pointer
- Numpy first occurrence of value greater than existing value
- Pickle or json?
- Can you make multiple “if” conditions in Python? [duplicate]
- How do I update a Python package?
- How should I choose between using instance vs. class attributes?
- How do I set browser width and height in Selenium WebDriver?
- cx_Freeze converted GUI-app (tkinter) crashes after pressing plot button
- Python pandas: remove everything after a delimiter in a string
- How can I do a batch insert into an Oracle database using Python?
- Efficient way to partially read large numpy file?
- Windows can’t find the file on subprocess.call()
- How do I bundle a Python application including dependencies into a Windows Installer package for distribution?
- How can I interleave or create unique permutations of two strings (without recursion)
- Principal component analysis in Python
- Why does subprocess.Popen() with shell=True work differently on Linux vs Windows?
- int object is not iterable while trying to sum the digits of a number? [duplicate]
- What are the differences between bool() and operator.truth()?
- dataframe to long format
- heatmap-like plot, but for categorical variables in seaborn
- How to get `setup.cfg` metadata at the command line (Python)
- yaxis range display using absolute values rather than offset values
- Pandas: Selecting rows based on value counts of a particular column