r/learnpython • u/mexicanlefty • Jul 09 '20
I made a calculator in Python!
Hello everyone!
I just wanted to share this project i made, its not my first programming project or python project whatsoever, but it is indeed the first one i didnt depended much on google or a video tutorial so that for me its a great advance.
The project is also my first on a github repository!
https://github.com/mexicanlefty/Python-Calculator
Please take a look and test it, in case you can provide any feedback it would be even better, it doesnt matter if you guys want to be very critical, i dont mind i want to keep practicing and i already have my next project in mind.
392
Upvotes
80
u/heyimpumpkin Jul 09 '20
divison by 0 breaks your calculator, most actions aren't performed after it and it doesn't display anyhting to user
entry on button_click is not used.
since empty string evaluates to False in python, you don't need to add != "" part, you can just leave it as
also, I didn't get into it too much but I don't understand why you need spearate current value variable for each operation?
overall it's cool you made it and it works.
A better way to structure it would be using classes. You wouldn't need globals and code would be better structured and less verbose overall.