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

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

 

posted on 2019-11-01 11:31  别动我的锅  阅读(5616)  评论(0)    收藏  举报

导航

levels of contents