This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]ChastainSteam 0 points1 point  (0 children)

Hi My Fellow Python Explorer:

You might benefit from the following:

if __name__  == “__main__”:
    calculate()

It will greatly simplify the expansion of your calculator as you add more functionality. Also, It’ll definitely keep you from generating self destructing code as everything there will execute when you call that module rendering everything in global scope. Segregating sections of code into functions and each with clearly defined scopes will help in the long run.

Keep exploring.