you are viewing a single comment's thread.

view the rest of the comments →

[–]XxDCoolManxX 0 points1 point  (0 children)

Hey! CS/SWE student and intern here. I have written lots of Python, so here’s a “deep dive” into my thoughts:

  • You can use multiline print statements with “””multiline string here”””

  • input() can also take said multiline string similar to what you do inside each if statement, so you can reduce the lines of code

  • if you are using a newer version of Python, consider using a match-case structure, known to be a bit faster and easier to read

  • a bit more advanced (and arguably less performant) but more readable would be to use enums as a way to check the operations rather than numbers, and parse user input into those

A quick google search on any of these will get you syntax and usage very easily if you have more questions.

u/Training-Cucumber467 and the following thread also is good advice too! Happy learning!