6/18 i dont understand


can you help me please i have forgotton how i can add variables and add them together


I don't know what the task for 6/18 is but to add 2 variables together you would do:

myVariable = 5
mySecondVariable = 7

variableTotal = myVariable + mySecondVariable

print variableTotal

Hope I helped answer your question!


instructions: Define a function called add_function that has 2 parameters x and y and adds them together.

so define the "add_function" with x, y

def add_function(x, y)

than take x and y and add them. to do that i like to create a variable to do the math in and have it store the result
add = x + y
creates a variable called add and sets it equal to x + y

next return the variable
return add

what the print function at the end does it changes x, y values to the value of m, n. so it replaces x + y with m + n(5 + 13)

m = 5
n = 13

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


i didnt get it as well, now i feel stupid xD


m = 5
n = 13
def addfunction(x,y):
total = 0
total = x + y
return total
print addfunction(m, n)