fork download
  1. x = 50
  2.  
  3. def func_outer():
  4. x = 2
  5. print('x равно', x)
  6.  
  7. def func_inner():
  8. global x
  9. print('x1 =', x)
  10. x = 5
  11. print('x2 =', x)
  12.  
  13. func_inner()
  14. print('x =', x)
  15.  
  16. func_outer()
  17.  
  18. print('гx =', x)
  19.  
Success #stdin #stdout 0.02s 28384KB
stdin
Standard input is empty
stdout
x равно 2
x1 = 50
x2 = 5
x = 2
гx = 5