Here is my code
def function(): global x x = 5 print (x)
How can I access the local variable x inside the function without calling the function itself?
x
Just put x = 5 outside the function
1.4m articles
1.4m replys
5 comments
57.0k users