Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 在字典中查找最大值_Python 3.x_Dictionary - Fatal编程技术网

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())