I've created a variable that adds two numbers together than another which multiplies that number by 2. After these two functions I try to then divide the result of these two functions by two. It will not work. Is it because I did not make the result of the previous function a global variable?
I've tried making it a global var but it doesn't work.
def add(num1,num2):
return num1 + num2
def multiply():
mult = add(1,2)*2
print(mult)
def divide():
start = multiply() /2
print(start)
divide()
I expected the result 3 but instead it threw up an error message instead. What did I do wrong?