Why does this code work:
var = 0 def func(num): print num var = 1 if num != 0: func(num-1) func(10)
but this one give
You can read a global without declaring it global. But to write a global, you need to declare it global.