fork download
  1. value = "global"
  2.  
  3. def pr():
  4. print("value scope: ", value)
  5.  
  6. def ex1():
  7. def f():
  8. def f():
  9. pr()
  10. f()
  11. f()
  12.  
  13. def ex2():
  14. value = "outer local"
  15. def f():
  16. def f():
  17. pr()
  18. f()
  19. f()
  20.  
  21. def ex3():
  22. def f():
  23. value = "inner local"
  24. def f():
  25. pr()
  26. f()
  27. f()
  28.  
  29. def ex4():
  30. def f():
  31. def f():
  32. value = "very local"
  33. pr()
  34. f()
  35. f()
  36.  
  37. ex1()
  38. ex2()
  39. ex3()
  40. ex4()
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
value scope:  global
value scope:  global
value scope:  global
value scope:  global