I am looking for a way to call a variable that is in other function.
Here is my example code
#test
def function1():
var1 = 10
def function2 ():
print(var1) #How to import var1 on this function?
function1()
function2()
Any ideas?
I have tried searching on google but there is no information, and I have tried like calling var1()
but that only results in an error.