I have this dictionary:
a_dict = {"car":5,"laptop":17,"telephone":3,"photo":14}
I would like to print the key which has the highest value. For example, I would like to print out the key laptop because it has the highest number
I have tried this so far:
def get_oldest(things):
new_list = []
for elements in things:
new_list.append(things[element])
new_list.sort()
Now, I have sorted the list from the smallest to the highest, so I know that the last item in the list has the highest value, but how do I match that to the correct key and print that.