The for index in range(len(list)) loop executes the loop body with index first set to 0, then 1, then 2, etc. up to len(list) - 1. The previous value of index is ignored and overwritten. If you want index to start at iteration + 1, use the 2-argument form of range:

for index in range(iteration + 1, len(list)):
Answer from user2357112 on Stack Overflow
๐ŸŒ
Quora
quora.com โ€บ Do-for-and-while-loops-begin-at-0-or-1
Do for and while loops begin at 0 or 1? - Quora
Answer (1 of 17): In most modern languages - they do what you tell them to do. [code]for ( i = 0 ; i
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_for_loops.asp
Python For Loops
To loop through a set of code a specified number of times, we can use the range() function, The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and ends at a specified number.
๐ŸŒ
Codecademy
codecademy.com โ€บ forum_questions โ€บ 4f52839209a70f0003014446
2.4: Why does the loop start at 0 and not 1? | Codecademy
Basically, my for loop wasnโ€™t acceptable until I changed the starting value from 1 to 0 and the ending value from <= max_value to < max_value. In other words, if we were going to 100, I wanted it to count from 1 to 100, but my code wouldnโ€™t work unless we count from 0 to 99. But why would we start at zero and end early if weโ€™re trying to sum up all the FizzBuzz numbers from 1 to 100?
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ how-to-start-a-for-loop-at-1-python
How to start a for loop at 1 - Python - GeeksforGeeks
July 23, 2025 - Let's see some methods to start a for loop at 1 in Python. range() function allows us to specify a start, stop, and step. By default, it starts at 0 but we can specify 1 as the starting point.
Find elsewhere
Top answer
1 of 3
10

You can start a loop at whatever you want. The reason you see loops starting at zero often, is because they are looping through an array. Since the first item in an array is at index '0', it makes sense to start looping from 0 to access every item in an array.

2 of 3
2

You should use i = 0 in situations where iterating starting at zero would be natural, as previously stated this could include array indexing or similar. Personally I would say I use this style at least 90% of the time, as when modelling problems in the computer we mold them to use built in data structures, which usually start at 0. Our minds become use to working in this style.

Starting at i = 1 is more natural for modeling many problems while designing algorithms. For example, if you are given a problem such as person 1 is x years old, person 2 is y years old, and so on, indexing using the given numbers may make it easier to give an answer if asked something such as who is the youngest person in the list. Experience and experimentation will teach you if this is worthwhile, in my experience, this can be helpful in things such as programming competitions (like the ICPC), where algorithms must be developed quickly with not much time for debugging, and the algorithms can be very complex, so the clarity is important.

In other words it may be beneficial to waste this first index if it adds clarity, however experienced programmers quickly learn to understand both styles.

However, if you start at zero, remember to be aware that the arrays still start at zero, and you will need an n + 1 size array to represent n elements if you use indexing starting at 1.

Also be aware of your conditional in the for loop.

for (int i = 0; i < 10; i++) - Will loop 10 times

for (int i = 1; i <= 10; i++) - Will loop 10 times

It is basic, but a common source of errors that may be hard to track down, especially for beginning programmers.

๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ python-for-loop-example
Python for loop | DigitalOcean
March 14, 2024 - Here, 100 is the start value, 0 is the stop value, and -10 is the range, so the loop begins at 100 and ends at 0, decreasing by 10 with each iteration. This occurs in the output: ... When programming in Python, for loops often make use of the range() sequence type as its parameters for iteration.
๐ŸŒ
Python
wiki.python.org โ€บ moin โ€บ ForLoop
ForLoop - Python Wiki
for x in range(0, 3): print("We're on time %d" % (x)) While loop from 1 to infinity, therefore running forever. x = 1 while True: print("To infinity and beyond! We're getting close, on %d now!" % (x)) x += 1 ยท When running the above example, you can stop the program by pressing ctrl+c at the same time.
๐ŸŒ
Boot.dev
boot.dev โ€บ lessons โ€บ 5d9561a2-87b0-44be-8bd1-b84ba62b639b
Learn to Code in Python: Loops Practice | Boot.dev
(print(i)) Add 1 to i. (range defaults ... must be indented; otherwise, you'll get a syntax error. In the print_numbers_from_five_to function, the for-loop starts at 0....
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_lists_loop.asp
Python - Loop Lists
Use the len() function to determine the length of the list, then start at 0 and loop your way through the list items by referring to their indexes. Remember to increase the index by 1 after each iteration.
๐ŸŒ
Python Course
python-course.eu โ€บ python3_for_loop.php
20. For Loops | Python Tutorial | python-course.eu
August 16, 2021 - We mentioned before that we can rewrite a for loop as a while statement. In this case it looks like this: performance_levels = ('beginner', 'novice', 'intermediate', 'advanced', 'expert') # Initialize an index to 0 index = 0 # Use a while loop to iterate through each level in the tuple while index < len(performance_levels): # Get the current level from the tuple level = performance_levels[index] # Print the current level print(level) # Increment the index to move to the next level index += 1