Python Global Variable Not Updating In Function On Calculator