def say_boo_twice():
global boo
boo = 'Boo!'
print boo, boo
boo = 'boo boo'
say_boo_twice()
The output is
Boo! Boo!
Not as I expected. Since I declared boo
as global, why is the output not:
boo boo boo boo
You've changed boo
inside your function, why wouldn't it change? Also, global variables are bad.