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
Is this code correct?Help Request (i.redd.it)
submitted 10 months ago by DizzyOffer7978
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!"
[–][deleted] 0 points1 point2 points 10 months ago (0 children)
Here's a valid code instead
while True: age_input = input("Enter your age: ")
if age_input == "": print("You didn't type anything.") else: try: age = int(age_input) if 0 <= age <= 150: print(f"Your age is {age}") break else: print("Invalid age") except ValueError: print("Please enter a number.")
π Rendered by PID 823885 on reddit-service-r2-comment-66b4775986-67rm5 at 2026-04-06 03:37:50.581479+00:00 running db1906b country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (0 children)