Python Variable Scope In Function In Excel