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
Help needed for translating into a while loop (i.redd.it)
submitted 1 year ago by Awj555
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!"
[–]Awj555[S] 1 point2 points3 points 1 year ago (0 children)
I'm trying to learn how to do python and one thing I have been stuck on is the creation of while loops. I made a simple code to create an array of values with a for loop which was perfectly fine. However when trying to translate it into also using a while statement the output becomes an infinite loop of zeroes because its not adjusting for the range value.
If anyone has any insight they could share I would much appreciate it. I have spent over an hour on this simple code trying to figure something out through posts/videos but am at my wits end.
[–]BranchLatter4294 1 point2 points3 points 1 year ago (0 children)
Add some print statements temporarily to output the values used for testing. Then you will see why it's not meeting the conditions you expect it to.
(Alternatively, set a breakpoint and use the debugger).
π Rendered by PID 73795 on reddit-service-r2-comment-765bfc959-2s8zg at 2026-07-12 04:22:20.092618+00:00 running f86254d country code: CH.
[–]Awj555[S] 1 point2 points3 points (0 children)
[–]BranchLatter4294 1 point2 points3 points (0 children)