def think(): x=1 def think2(): nonlocal x x=2 think2() return x print(think())