Python Nested Function Global Variable Example