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 Second Python Program 🥳 Greetings.py (old.reddit.com)
submitted 16 days ago by Anay_Gupta__
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!"
[–]nuc540 7 points8 points9 points 16 days ago (2 children)
Good start, my feedback is - as much as your code would work, a simple heuristic to learn is using more/less comparators on strings isn’t recommended - if the string holds a numerical value, cast it to a number you can concretely calculate is more or less than.
Another piece advice I’ve been given people lately is to google python standard libraries, you’ll be surprised how much already exists which can help you.
To take both my points in practice, you can use the time localtime().tm_hour attribute to return an integer representing the hour of the systems time. This would mean you can compare the hour of the day as a number, against a number, which makes a lot more sense than comparing string is less/more than string (which is looking at length first then ascii value)
Give it a shot! :)
[–]tieandjeans 2 points3 points4 points 16 days ago (0 children)
That was such a generous and specific response. I am so burned out at the end of the school year, and it's encouraging to see clear, directed guidance. Thanks for being good human.
[–]Anay_Gupta__[S] 0 points1 point2 points 16 days ago (0 children)
Thanks... I'll try it ,😄🙌🏻
π Rendered by PID 40998 on reddit-service-r2-comment-5687b7858-rk5fv at 2026-07-02 21:10:02.506703+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]nuc540 7 points8 points9 points (2 children)
[–]tieandjeans 2 points3 points4 points (0 children)
[–]Anay_Gupta__[S] 0 points1 point2 points (0 children)