Please somebody Help me! my function don't work!


#1

this is my code
maximum = [2,4,6,8,10,12,14,16,18,20]
def max(maximum):

print max

but th console show me this message!

File "python", line 6
print max
^
IndentationError: expected an indented block


#2

try this

maximum = [2,4,6,8,10,12,14,16,18,20] 
def maxnum(list):
    print max(list)
maxnum(maximum)

#3

thank you men! but I don't understand that was wrong ?


#4

max is a reserved keyword in python so you cannot use it unless you are calling it but then you called it here

def max(maximum):

now in your implementation you worte

print max

but max(language default) is a function so when you call your method like this

print max(maximum)

it gives you a function object like so

<function max at 0x23467c>

Hope this helps?


#5

of course men! thank you but I want ask you this code ...

minimum = [2,4,6,8,10,12,14,16,18,20]
def minimun1(list)

print min(list)

minimun1(minimun

I wrote similar than your advice but don't work


#6

try

minimum = [2,4,6,8,10,12,14,16,18,20]
def minimun1(list):
    print min(list)

minimun1(minimum)

you have syntax and spelling errors