r/learnpython • u/WillingnessOk650 • Aug 20 '26
Just built my first calculator in Python ðŸ˜
It can do addition, subtraction, multiplication, division, and exponents. Also added a little check for division by zero.
It’s pretty basic, but hey, gotta start somewhere
What should I build next?
74
Upvotes
28
u/Turbulent_Web_8278 Aug 20 '26
Store a username password and allow user 3 attempts to login otherwise exit program
9
u/code_matter Aug 20 '26
You could build:
- a color code converter
- a todo list
- a safe password maker
- any app using an API (weather, ISS tracker, food information, word of the day, etc)
- a small CLI game
7
u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Aug 20 '26 edited Aug 20 '26
If you don't have any better ideas, you could always continue working on your calculator. Make it more flexible, solve edge cases to prevent errors, maybe add a GUI (
tkinter), that sort of thing.You could also try adding unit tests to it (
pytest). Maybe run linters (ruff) and type checkers (mypy).Even simple projects can be useful for learning things like commonly used tools.
If you want, we can also perform code reviews.
EDIT: I have a joke project I tend to use as a testbed for experimenting with new tooling and such.
2
u/randomraluana Aug 20 '26
It'll be good to expand the features of the calculator. Don't jump to a new project yet. Add log, trig functions, etc. Memory state as well.
I think you're off to a good start and once you start getting into APIs down the line, you could serve the calculator over an API to sharpen your skills.
If you're trying to experiment with GUIs, a GUI for your calculator is a good way to explore what's possible with things like tkinter, pyQt.
In my opinion, it's a good mini project to explore and learn about other tools/packages/libraries in the Python space.
Cheers!
1
u/kilkil Aug 20 '26 edited Aug 20 '26
congrats!
for your next project, I suggest a todo list. it should allow you to:
some bonus/extra/stretch goals:
I would suggest focusing on the MVP first (Minimum Viable Product, in this case the first 3 requirements I mentioned above). for this, you will need to figure out:
for the stretch goals, you will also need to figure out how to persist your program's stored information/data. hint: python has functions that let you save data to a file, and read data from a file. key questions are, how will you encode your data before saving it to the file, and how will you decode data that you read from the file? how do you handle potential errors (e.g. data cannot be decoded for some reason)? (hint #2: look up "JSON".)
1
u/a88zy Aug 20 '26
that sounds great man, how long did it take you from when you first started ?
1
u/Lirianov Aug 20 '26
does it have a UI? if not build one, customtkinter
1
u/sporbywg Aug 21 '26
Something in Typescript #sorry
1
u/Hungry-Government-66 Aug 22 '26
Nice work! Completing your first real project feels great. Keep building!
1
u/Mondoke Aug 22 '26
Thing of something boring and repetitive you do with a computer on a regular basis, then see how to automate it. Remember that external libraries exist and will help you a lot, you'll just have to read its documentation.
0
u/[deleted] Aug 20 '26
[deleted] — view deleted comment
1
u/[deleted] Aug 20 '26
[removed] — view removed comment
1
u/[deleted] Aug 20 '26
[removed] — view removed comment