using function variable in other function python code example
Example 1: how to access variable of one function in another function in python
def fun1():
fun1.var = 100
print(fun1.var)
def fun2():
print(fun1.var)
fun1()
fun2()
print(fun1.var)
Example 2: how to use variable from another function in python
s = Spam()
s.oneFunction(lists)
s.anotherFunction()