python练习-查找出字典中值最大的键值对

时间:2019-11-01 13:15:08   收藏:0   阅读:2222
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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!