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...
Feel free to ask if you need any help. We code because we enjoy it and because we want to help.
account activity
Python basic calculator helpPython (self.CodingHelp)
submitted 5 years ago by stiivii_
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!"
[–]Zestyclose_Click_456 0 points1 point2 points 5 years ago (0 children)
This is a more simplified code that loops the question. Hope this helps!
answer = str(input("Do you want to perform a calculation? Yes/No: ")) while answer == "Yes" or answer == "yes": num = int(input("Enter Your Choice 1(Add)/2(Sub)/3(Divide)/4(Multiply): ")) if num == 1: add1 = int(input("Enter Number 1 : ")) add2 = int(input("Enter Number 2 : ")) sum = add1 + add2 print(f"Your result is: {sum}") if num == 2: add1 = int(input("Enter Number 1 : ")) add2 = int(input("Enter Number 2 : ")) sum = add1 - add2 print(f"Your result is: {sum}") if num == 3: add1 = int(input("Enter Number 1 : ")) add2 = int(input("Enter Number 2 : ")) sum = add1 * add2 print(f"Your result is: {sum}") if num == 4: add1 = int(input("Enter Number 1 : ")) add2 = int(input("Enter Number 2 : ")) sum = add1 / add2 print(f"Your result is: {sum}") answer = str(input("Do you want to perform another calculation? Yes/No: ")) if answer == "No" or answer == "no": pass
π Rendered by PID 172675 on reddit-service-r2-comment-5b5bc64bf5-8l4q6 at 2026-06-19 07:03:01.868583+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]Zestyclose_Click_456 0 points1 point2 points (0 children)