Help on Functions 13. max()


#1



https://www.codecademy.com/courses/python-beginner-c7VZg/3/2
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!

maximum=

print maximum


#2

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.


#3

simple example:

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

#4

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


#5

i think you should refresh your browser then write the code


#6

Try inputing values in numerical order such as,

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

print maximum

#7

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!


#8

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