my_globvar = 0

def change_globvar():
global my_globvar # Needed to modify m_globvar
my_globvar = 1

# we can change value of global variable
change_globvar()
print(my_globvar)

Younes Derfoufi
my-courses.net

Leave a Reply