x = 20 def func(y): global x x = 10 print(x, y, "in func") print(x, "before func") func(x) print(x, "after func") # # main x -> main.x <- 20 # func x -> func.x <- 10 # main x -> main.x stays 20 #