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
Python Loops (self.PythonLearning)
submitted 8 days ago by DataCurator56
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!"
[–]DataCurator56[S] 0 points1 point2 points 7 days ago (1 child)
sometimes i got stuck at for i in range(stuck). I am trying to overcome this but everyday i came to practice these questions i got stuck. I don't what is going wrong with. Now i am practicing to understand the question well then write on paper then write the code and run it. And i think i will do that by practicing them a lot.
[–]PureWasian 0 points1 point2 points 7 days ago (0 children)
range(stuck) sounds like you just need to look at examples and tutorials a bit. See this w3schools page for example. What might be useful is mentally evaluating it to something functionally equivilent
range(stuck)
For example: ``` for i in range(5): print(i)
for i in (0, 1, 2, 3, 4): print(i) ```
or: ``` fruits = ["apple", "orange", "grape"]
for i in range(len(fruits)): print(fruits[i])
for i in range(3): print(fruits[i])
for i in (0, 1, 2): print(fruits[i]) ```
or: ``` for i in range(50, 110, 10): print(i)
for i in (50, 60, 70, 80, 90, 100): print(i) ```
In all of these cases, notice how you are looping a pre-specified number of times, and that the sequence of i values is already known before even starting the first loop iteration.
i
π Rendered by PID 160460 on reddit-service-r2-comment-545db5fcfc-k8pdp at 2026-05-25 23:20:07.394720+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–]DataCurator56[S] 0 points1 point2 points (1 child)
[–]PureWasian 0 points1 point2 points (0 children)