def get_keys(d, value):
return [k for k,v in d.items() if v == value]
get_keys({'a':'001', 'b':'002'}, '001') # => ['a']
字符串里面有参数用f
tinydict[f"{id}"]
标签:get,python,去区,value,dic,keys From: https://www.cnblogs.com/gnz48/p/16643833.html
def get_keys(d, value):
return [k for k,v in d.items() if v == value]
get_keys({'a':'001', 'b':'002'}, '001') # => ['a']
字符串里面有参数用f
tinydict[f"{id}"]
标签:get,python,去区,value,dic,keys From: https://www.cnblogs.com/gnz48/p/16643833.html