没有。dict
不打算以此方式使用。
for name, age in dictionary.items(): # for name, age in dictionary.iteritems(): (for Python 2.x)
if age == search_age:
print(name)
Python-按字典中的值获取密钥
没有。dict
不打算以此方式使用。
for name, age in dictionary.items(): # for name, age in dictionary.iteritems(): (for Python 2.x)
if age == search_age:
print(name)