The following line gives me the maximum value from the dictionary. But I need to access the key with respect to the max(value) of the dictionary. Help !
print("The winner is",max(biddinglist.values()))
Answer
You can use the max function with the key parameter. Note that this is equivalent to looping through all of the key / value items and is therefore O(n)
max(biddinglist.items(), key=lambda i: i[1])[0]