6/12 List and Function: Basic Question


#1
m = 5
n  = 13
# Add add_function here!
def add_function(x, y):
     for(function body goes here)?

print add_function(m,n)

I know this a basic question, but is my function body m and n? If so, how do I get them to print?


#2

I am not sure why you are using for in your function. Try to make your function adding it's variables and returning the sum.


#3

Thanks for the reply, however, I'm still getting an error message. Here's my code:m = 5
n = 13

Add add_function here!

def add_function(x, y):
print x + y
print add_function(m, n)

Error message says:

18
None
None

Save & Submit Code
Reset Code
Oops, try again. add_function(-9, 0) returned None, did you remember to return the result?
How do I return the result. Thanks!


#4

here is my code:

m = 5
n = 13

Add add_function here!

x = 12
y = 5
def add_function(x, y):
return x + y
print add_function(x, y)

it worked for me. Hope its helps.


#5

use return x + y, instead of print x + y.


#7

this is the answer
m = 5
n = 13
def add_function(x, y):
return x + y
print add_function(m, n)