premaseem.wordpress.com
Python : How to set a global variable in a function
x = 1 # make a global module variable def f(): print x # try to print the global … for j in range(100): if q > 3: x=4 Any variable assigned in a function is local to that function, unless …