Python Variable Scope In Function On Calculator