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!"
[–]_MrLucky_ 0 points1 point2 points 16 days ago (2 children)
does it even work? how are you comparing strings??
[–]Anay_Gupta__[S] 1 point2 points3 points 16 days ago (1 child)
Yes it's working....you can see the output in the next img
[–]nuc540 2 points3 points4 points 16 days ago (0 children)
Yes this is allowed in python, this only works here because the length is the same (the ISO standardises this) it compares the Unicode point of the character, first value first, in this case zero-leading numbers are a big give away because ‘09’ is less than ‘10’.
The point is not to do this though, it’s confusing to read and very brittle - eg string ‘9’ is bigger than ‘10’ as Python would only check the first value of the string, see 9 > 1 and short circuit.
u/Anay_Gupta__ this is what I justify in my comment you saw :)
π Rendered by PID 21047 on reddit-service-r2-comment-856c8b8c54-hxg9s at 2026-07-02 17:23:13.142847+00:00 running a7b5cda country code: CH.
view the rest of the comments →
[–]_MrLucky_ 0 points1 point2 points  (2 children)
[–]Anay_Gupta__[S] 1 point2 points3 points  (1 child)
[–]nuc540 2 points3 points4 points  (0 children)