Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #access #variable #function #function #python
ADD COMMENT
Topic
Name
7+6 =