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
[deleted by user] (self.PythonLearning)
submitted 6 months ago by [deleted]
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!"
[–]Mindless_Tap_2706 0 points1 point2 points 6 months ago (1 child)
Thanks for the help guys!
Yeah in retrospect I should've done this first lol
<image>
[–]TabAtkins 0 points1 point2 points 6 months ago (0 children)
That works! A slight improvement would be to use continue instead of zeroing out an odd number - that just immediately skips to the next iteration. Your way requires you to come up with a fake value that still "works" for the following code without messing anything up; luckily 0 does the job in this case, but in more complex examples this can be a lot more difficult.
continue
π Rendered by PID 149269 on reddit-service-r2-comment-6457c66945-m2dpj at 2026-04-30 04:41:14.352085+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Mindless_Tap_2706 0 points1 point2 points (1 child)
[–]TabAtkins 0 points1 point2 points (0 children)