通过了解字典中的值,有没有直接找到密钥的方法?
我能想到的就是:
key = [key for key, value in dict_obj.items() if value == 'value'][0]
python dictionary
dictionary ×1
python ×1