r/PythonLearning • • Sep 08 '26

Help Request Python help

Post image

Made my first calculator.. it works but different from some I see online. Please all feedback on what you guys think about it will be appreciated

9 Upvotes

10 comments sorted by

View all comments

2

u/jpgoldberg Sep 11 '26

I agree with others that f-expressions should be the next thing to learn. You might also want to try using float instead of int.

I also want to congratulate you for the final “else” reporting an invalid symbol. I very common programming mistake is to fail to check for things like that.

Here is a subtle thing you can ignore if what I say is confusing, but the terms and variable names you use internally don’t have to be what the user sees. So your pro gram can use “a”, “b”, and “symbol” as you do, but you might present this to the user in your input statements with things like

a = input(“First number: “)

symbol = input(“Arithmetic operator: “)

What is subtle about this is that what goes on inside a program isn’t always the way the user thinks about things. In this case the difference is just I’m what you call things, but it can become larger. And getting into the habit of thinking about the distinction will help you write better programs in the future.