Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python Modifying Global Variable From Inside the Function

c = 1 # global variable
    
def add():
    c = c + 2 # increment c by 2
    print(c)

add()
Source by www.python-kurs.eu #
 
PREVIOUS NEXT
Tagged: #Python #Modifying #Global #Variable #From #Inside #Function
ADD COMMENT
Topic
Name
2+2 =