r/PythonLearning • u/Radiant-Safe-1377 • Nov 09 '25
How can I improve?
I took Python at uni, but the topics were treated separately and we never got to put it all together, so I want to do small projects on my own to improve. Here's a little calculator I put together, critiques and tips are welcome. I'd like to practice some more, but idk what or where to start?
I hope this makes sense, English isn't my first language
163
Upvotes
7
u/ItsGraphaxYT Nov 09 '25
First thing you can use instead of elif's is using
matchandcase2. You could also put the
print(result)outside of the elif's (putresult = "Input Error"instead of theprint...so it dosen't break and give the same result. 3. You can remove thefloat()from every elif statement and putfloat(input(...))instead in the beginning.The suggestions don't make the code faster, but makes it use less lines and less function calls (shorter code)