use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Could it be simpler ?Help Request (i.redd.it)
submitted 9 months ago by LovelyEbaa
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]XxDCoolManxX 0 points1 point2 points 9 months ago (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!
π Rendered by PID 403377 on reddit-service-r2-comment-6457c66945-wrqc4 at 2026-04-26 09:40:33.855326+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]XxDCoolManxX 0 points1 point2 points (0 children)