fork(4) download
  1.  
  2. def func_outer():
  3. x = 2
  4. print('x равно', x)
  5. def func_inner():
  6. nonlocal x
  7. x = 5
  8. func_inner()
  9. print('Локальное x сменилось на', x)
  10.  
  11. func_outer()
Success #stdin #stdout 0.1s 10104KB
stdin
Standard input is empty
stdout
x равно 2
Локальное x сменилось на 5