Help on Functions 13. max()

Functions 13 Max

I've tried several versions and just don't understand what I'm doing wrong. Probably something exceedingly simple. Please help or explain.

Should return the max of a set of numbers

# Set maximum to the max value of any set of numbers on line 3!


print maximum


You need to use the max() function to return the max value from an inputted set of numbers. For example max(54,15,26) would return 54 since it is the max value.

So maximum should equal the max function with whatever input you want.


simple example:

maximum = max(4,5,6)
print maximum


That's exactly what I thought it should be and that is what I've been doing but I keep getting this error:

Traceback (most recent call last):
File "python", line 3, in
TypeError: 'tuple' object is not callable


i think you should refresh your browser then write the code


Try inputing values in numerical order such as,

maximum = max(1, 2, 3, 4, 5, 6)

print maximum


Thanks that worked. Apparently just needed to refresh my browser and rewrite. Couldn't believe that something so simple was causing me so much trouble. Arggh!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.