Access Global Variable Inside Function Python Syntax For Loop