Python 3.x 在字典中查找最大值
我需要在嵌套字典中找到最大值Python 3.x 在字典中查找最大值,python-3.x,dictionary,Python 3.x,Dictionary,我需要在嵌套字典中找到最大值 data = {'violations': {'fatal': {'col1': 1, 'col2': 7, 'col3': 9}}} 那么如何在data.inflictions.fatal中的键col1、col2和col3中找到最大值呢 max(data['violations']['fatal'].values())
data = {'violations': {'fatal': {'col1': 1, 'col2': 7, 'col3': 9}}}
那么如何在data.inflictions.fatal
中的键col1
、col2
和col3
中找到最大值呢
max(data['violations']['fatal'].values())