Nov-10-2018, 06:38 PM
your function should return value and you will assign the returned value to the variable you want to change. The function may or may not take arguments.
def multiply(number): return number*3 my_var = 2 my_var = multiply(my_var) print(my_var)in this example I pass my_var as argument to the function, but that's not mandatory nor always the case
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs