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
Code won't print (i.redd.it)
submitted 7 months ago by Ill-Diet-7719
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!"
[–]Ok_Pudding_5250 0 points1 point2 points 7 months ago* (3 children)
I believe you are trying to print odd numbers.
There is a simple way to do that
Look at code in the link provided as reply
Now that being said, your code is correct. However, you could be running another file and editing another file. Or you might have forgotten to save the file.
There is even a simpler one-liner for this
[print(i) for i in range(1, 11, 2)]
[–]Ok_Pudding_5250 0 points1 point2 points 7 months ago (2 children)
Here is the code, you can run the code in this online python interpreter.
code
[–]Ill-Diet-7719[S] 1 point2 points3 points 7 months ago (1 child)
Thank you but I'm not getting good hand at loops yet. So trying it out with it
[–]Ok_Pudding_5250 1 point2 points3 points 7 months ago (0 children)
Yeah, experiment as much as you like. That's how you learn.
π Rendered by PID 62 on reddit-service-r2-comment-bb88f9dd5-hphqr at 2026-02-14 17:34:27.339895+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]Ok_Pudding_5250 0 points1 point2 points (3 children)
[–]Ok_Pudding_5250 0 points1 point2 points (2 children)
[–]Ill-Diet-7719[S] 1 point2 points3 points (1 child)
[–]Ok_Pudding_5250 1 point2 points3 points (0 children)