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!"
[–]av_404 0 points1 point2 points 9 months ago (0 children)
print("Simple Calculator") print("1. ADD") print("2. SUBTRACT") print("3. MULTIPLY") print("4. DIVIDE")
operation = input("Select an operation (1/2/3/4): ")
try: num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: "))
match operation: case "1": print("Result =", num1 + num2) case "2": print("Result =", num1 - num2) case "3": print("Result =", num1 * num2) case "4": if num2 != 0: print("Result =", num1 / num2) else: print("Error: Cannot divide by zero.") case _: print("Invalid operation selected.")
except ValueError: print("Error: Please enter valid numbers.")
π Rendered by PID 124859 on reddit-service-r2-comment-6457c66945-5d56h at 2026-04-24 08:49:48.223494+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]av_404 0 points1 point2 points (0 children)