input: # 需求,查找出字典中值最大的键值对 d = {‘1‘:"a",‘2‘:‘b‘,‘3‘:‘c‘} new_tup = zip(d.values(),d.keys()) #(‘a‘, ‘1‘), (‘b‘, ‘2‘), (‘c‘, ‘3‘) print(max(new_tup)) output: (‘c‘, ‘3‘)
原文地址:https://www.cnblogs.com/liangyf/p/11776021.html
时间: 2024-10-11 16:03:03
input: # 需求,查找出字典中值最大的键值对 d = {‘1‘:"a",‘2‘:‘b‘,‘3‘:‘c‘} new_tup = zip(d.values(),d.keys()) #(‘a‘, ‘1‘), (‘b‘, ‘2‘), (‘c‘, ‘3‘) print(max(new_tup)) output: (‘c‘, ‘3‘)
原文地址:https://www.cnblogs.com/liangyf/p/11776021.html