Python Function Update Global Variable