Update Global Variable In Python Function