Skip to content Skip to sidebar Skip to footer

How To Show The Max And Min From User Input?

Nevermind if xmin == 1: print(ymin) I tried using the max and min but I get a typeerror which is 'int' object not iterable.

Solution 1:

You cannot use min() and max() with integers. It really makes no sense trying to ask a minimum or maximum if computer only has one number to work with. You need to add user inputs into a list like so:

ages = []
ages.append(age)

After you've done this you can use min() and max() methods:

a = min(ages)

Post a Comment for "How To Show The Max And Min From User Input?"