Back in 2018 when I coded this, all I knew about programming and python was from a mobile app. I decided this was going to be my first project. In 2019 I redid the program because from a StackOverflowPost I made someone told me about the existence of libraries and that I really did not need to code everything on my own. I publish both versions here as Old Program and BetterProgram.
For the first, I only used the math library. I remember to spend days thinking on how could I represent the Tartaglia triangle following something simmilar I found on the internet and how to calculate the Combinations. Finally I succeded, it had some issues like not being able to calculate with variables that had an unknown value, but which I did not know how to solve on my own at that time. An example of a possible operation:
$ (4 + 5)^3 $
You can check the results in the same folder as the script, I have an example of an Easy operation and another that froze my (new then) computer for some minutes(don't try it at home).
After that and the tips I recieved in Stackoverflow, I saw that I wrote a lot of algorithms unneeded. I refactored the whole code and learnt to use sympy. Now it was able to not only use unknown variables, but also put exponents inside the variables. For example:
You can check the video if you want to check it out. (Sorry for the stereotypical music and format. Though to be honest I find it quite charming, it really is a gate to the past)
I learnt quite a lot about how to turn the algorithms from the head to functional code, and how essential and lifesaving libraries really are.
Nowadays (2022) I've already passed 2 of the 4 years in order to earn a Computer Science Degree, and I'm able to see a lot of mistakes which I didn't know at that time (such as not adding comments for every function with at least a #pre and a #post, A while true and breaks that would have gotten me failed had I shown it at the first programming class...)
If you are interested in learning to program and find this, feel free to contact me! It really can be dificult to have a good base without some sort of guidance. You should be able to find the mail at my GitHub Profile.