More than one argument


#1


Hi everyone,

Not sure if this has been posted before but could someone explain what is wrong with the syntax here?

I was expecting to add the two variables together 5 + 8 = 13.

Unfortunately I am receiving an error message like the below:
Oops, try again. add_function(1, -10) returned 18 instead of -9

m = 5
n = 13
def add_function(x,y):
    return m + n 

print add_function(m, n)

#2

Hi @chiprockstar20924,

You have this ...

return m + n

... however you should be using the function parameters, x and y.

As you have it now, the function ignores the parameters and accesses the global variables instead.


#3

Hey @appylpye

Thanks very much for the swift response - schoolboy error!

Kind regards
Johnny


#4