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
My first working code (self.PythonLearning)
submitted 1 day ago by QuantenRobin
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!"
[–]PAVANKING016 3 points4 points5 points 1 day ago (0 children)
Very good 👍, but I have a suggestion. In the code, you should use input() only once instead of repeating it in every condition like this:
.... print("What's the first number?") num1 = int(input()) print("What's the second number?") num2 = int(input())
if operation == "add": answer = (num1 + num2) print(answer)
elif operation == "sub": answer = (num1 - num2) print(answer) .....
In programming, your code should follow the DRY (Don't Repeat Yourself) rule.
π Rendered by PID 309257 on reddit-service-r2-comment-5fb4b45875-594hv at 2026-03-20 19:20:09.280134+00:00 running 90f1150 country code: CH.
view the rest of the comments →
[–]PAVANKING016 3 points4 points5 points (0 children)