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))
print(min(new_tup))
output:
('c', '3')
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))
print(min(new_tup))
output:
('c', '3')
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。