I am writing a Python program that produces a list similar to the code block below. The user inputs ten numbers, which are stored in a list. It counts the number of distinct objects. The first number in each ( ) is the number the user entered, and the second value is how many times it was entered. What I need to do is essentially print out to the user "The most common number is x which was entered y times".
organizedList = [(1.0, 5), (5.0, 3)]
print max(organizedList)
I tried a normal max command, but it chooses the second value as the max even thought it was chosen less often. Thank you for your help.