def myfun(): x_local = 20 global x_global x_global += 1 x_global = 10 myfun() print('x_global =', x_global) print('x_local =', x_local)