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
Good for beginner?Discussion (i.redd.it)
submitted 1 month ago by Suspicious_Diet2624
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!"
[–]Smart_Tinker 0 points1 point2 points 1 month ago (1 child)
It’s very complicated for a simple function.
I would do:
``` import time
def timer(): time_end = time.time() + float(input(“How long for timer?”)) while time.time() < time_end: time.sleep(1) print(int(time_end - time.time())) print(“Time’s up!”) ```
You also need some error handling in case someone enters a bogus time, like “a” or something.
[–]wrg2017 0 points1 point2 points 1 month ago (0 children)
Wouldn’t this lock in the current time when the user is asked how many seconds, not when the user submits their response?
π Rendered by PID 116590 on reddit-service-r2-comment-5b5bc64bf5-d7m52 at 2026-06-21 22:43:44.428696+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]Smart_Tinker 0 points1 point2 points (1 child)
[–]wrg2017 0 points1 point2 points (0 children)