From the documentation:

range([start], stop[, step])

The start defaults to 0, the step can be whatever you want, except 0 and stop is your upper bound, it is not the number of iterations. So declare n to be whatever your upper bound is correctly and you will not have to add 1 to it.

e.g.

>>> for i in range(1, 7, 1): print(i)
... 
1
2
3
4
5
6
>>> for i in range(1, 7, 2): print(i)
... 
1
3
5

A nice feature, is that it works in reverse as well.

>>> for i in range(7, 0, -1): print(i)
... 
7
6
5
4
3
2
1

If you aren't using it as an index but for something that can have positive or negative values, it still comes in handy:

>>> for i in range(2, -3, -1): print(i)
... 
2
1
0
-1
-2
>>> for i in range(-2, 3, 1): print(i)
... 
-2
-1
0
1
2
Answer from Rolf of Saxony on Stack Overflow
🌐
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 - Python for loops range typically starts at 0. However, there are cases where starting the loop at 1 is more intuitive or necessary such as when dealing with 1-based indexing in mathematics or user-facing applications.
Discussions

python - Pythonic way to iterate through a range starting at 1 - Stack Overflow
Currently if I want to iterate 1 through n I would likely use the following method: for _ in range(1, n+1): print(_) Is there a cleaner way to accomplish this without having to reference n + 1... More on stackoverflow.com
🌐 stackoverflow.com
Python for loop start counter initialization - Stack Overflow
index is being reassigned anyway within the for-loop so index = iteration + 1 is not having any effect. ... list is not a keyword. It's a builtin identifier; reassigning it is valid, but generally a bad idea. 2013-07-06T00:29:18.94Z+00:00 ... I'd upvote TerryA's answer. However I like to improve his answer to meet OP request and make it conform to Python3... More on stackoverflow.com
🌐 stackoverflow.com
python - Why is this for loop starting at index 1 instead of index 0? - Stack Overflow
I was just confused on why index 0 was being skipped for i, but it was explained below. ... Sign up to request clarification or add additional context in comments. More on stackoverflow.com
🌐 stackoverflow.com
Can a for loop start somewhere other than 0?
Sure, slice the list: for x in l[2:]: More on reddit.com
🌐 r/learnpython
60
113
June 21, 2022
🌐
W3Schools
w3schools.com › python › python_for_loops.asp
Python For Loops
The range() function defaults to 0 as a starting value, however it is possible to specify the starting value by adding a parameter: range(2, 6), which means values from 2 to 6 (but not including 6): ... The range() function defaults to increment ...
🌐
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
🌐
Codecademy
codecademy.com › forum_questions › 4f52839209a70f0003014446
2.4: Why does the loop start at 0 and not 1? | Codecademy
That is, 0 through 99. However, in this special case, you add the loop variable i to the sum, so you could start at 1. But don’t!. Sometime later you’ll modify or copy the code where do want to loop 100 times.
🌐
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.
Find elsewhere
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › how to start python for loop at 1
How to Start Python For Loop at 1 - Spark By {Examples}
May 31, 2024 - We can start the for a loop at index 1 in several ways in Python, in general, the for loop is used to iterate over a sequence (such as a list,
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-for-loop-example
Python for loop | DigitalOcean
March 14, 2024 - for n in range(1, 10, 3): print("Printing with step:", n) # Output # Printing with step: 1 # Printing with step: 4 # Printing with step: 7 · We can also use a negative value for our step argument to iterate backwards, but we’ll have to adjust our start and stop arguments accordingly: ... 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.
🌐
Delft Stack
delftstack.com › home › howto › python › python for loop start at 1
How to Start a for Loop at 1 in Python | Delft Stack
March 11, 2025 - In this code snippet, enumerate(my_list, start=1) starts the index at 1 instead of the default 0. This means that as you iterate through my_list, the index will begin counting from 1, which can be particularly useful for displaying results in ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › loops-in-python
Loops in Python - GeeksforGeeks
It allow to execute a block of code repeatedly, once for each item in the sequence. ... Explanation: This code prints the numbers from 0 to 3 (inclusive) using a for loop that iterates over a range from 0 to n-1 (where n = 4).
Published   2 weeks ago
🌐
Real Python
realpython.com › python-for-loop
Python for Loops: The Pythonic Way – Real Python
February 23, 2026 - In this example, instead of using enumerate() to produce zero-based indices, you start the count at 1. From the end user’s perspective, starting the menu at 1 is the natural way to go.
🌐
Boot.dev
boot.dev › lessons › 5d9561a2-87b0-44be-8bd1-b84ba62b639b
Learn to Code in Python: Loops Practice | Boot.dev
As a reminder, a "for loop" in Python is written like this: ... Start with i equals 0. (i in range(0)) If i is greater than or equal to 10 (range(0, 10)), exit the loop. Print i to the console. (print(i)) Add 1 to i.
🌐
IBM
ibm.com › reference › python › for-loop
What is a for loop in python? | IBM
November 21, 2025 - Notice how the range function will automatically increment the i counter. The loop iterates through all values of i from 0–4, which correspond to a range of 5. In Python programming, the counting starts from 0, not from 1.
🌐
Manifoldapp
cuny.manifoldapp.org › read › how-to-code-in-python-3 › section › f75bdda8-84fa-4972-bf76-747203948f55
How To Construct For Loops | How To Code in Python 3 | Manifold @CUNY
Keep in mind that in programming we tend to begin at index 0, so that is why although 5 numbers are printed out, they range from 0-4. You’ll commonly see and use for loops when a program needs to repeat a block of code a number of times. One of Python’s built-in immutable sequence types ...
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.