取字典info中值为10000的key值:
def getkeys(key): info = {"刘江红": 12000, "曹俊杰": 10000, "赵磊": 10000} for i in info.keys(): if info[i] == key: print(i)getkeys(10000)
取字典info中值大于10010的key值:
def getkeys(v): info = {"刘江红": 12000, "曹俊杰": 11000, "赵磊": 10000} info["李俊"] = 10000 for i,key in info.items(): if info[i] == key and key > v: print(i)getkeys(10010)
原文地址:https://www.cnblogs.com/choco1986/p/9054903.html
时间: 2024-10-28 06:13:22