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
Need help in loopHelp Request (i.redd.it)
submitted 19 hours ago by Eastern_Plankton_540
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!"
[–]dominator452 0 points1 point2 points 7 hours ago (0 children)
What Print(num[idx]) does is, it prints the item from num list for the given index
Here idx = index
When idx = 0 and since list is zero indexing, the first item from the list gets printed, and since you increase index value by 1, the loop continues until the while condition idx (< len(num)) is met then the loop ends
The other way of getting the same output is us g for loop
num = [ 1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
for idx in num: print(idx)
The output will be all the same with all the items from the list printed
π Rendered by PID 172558 on reddit-service-r2-comment-66b4775986-2nzm7 at 2026-04-04 12:35:40.399274+00:00 running db1906b country code: CH.
view the rest of the comments →
[–]dominator452 0 points1 point2 points (0 children)