I made a function which will look up ages in dictionary and give out there name
my dictionary si for example {george:16,amber:19}
i made this
search_age = raw_input("Provide age")
for age in list.values():
if age == search_age:
name = list[age]
print name
but i know how to compare and find the age i just dont know how to show the name of the person, additionally i am getting key error, i know it because of line 4, i know its not correct but i cant figure out to make it search backwards.
any help would be appreciated
Thanks in advance