Because it's more common to call range(0, 10) which returns [0,1,2,3,4,5,6,7,8,9] which contains 10 elements which equals len(range(0, 10)). There's a tendency in programming to use 0-based indexing.

Also, consider the following common code snippet:

for i in range(len(li)):
    pass

Could you see that if range() went up to exactly len(li) that this would be problematic? The programmer would need to explicitly subtract 1. This also follows the common trend of programmers preferring for(int i = 0; i < 10; i++) over for(int i = 0; i <= 9; i++).

If you are calling range with a start of 1 frequently, you might want to define your own function:

>>> def range1(start, end):
...     return range(start, end+1)
...
>>> range1(1, 10)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Answer from moinudin on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_func_range.asp
Python range() Function
Python Examples Python Compiler ... Python Training ... The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and stops before a specified number....
Top answer
1 of 11
331

Because it's more common to call range(0, 10) which returns [0,1,2,3,4,5,6,7,8,9] which contains 10 elements which equals len(range(0, 10)). There's a tendency in programming to use 0-based indexing.

Also, consider the following common code snippet:

for i in range(len(li)):
    pass

Could you see that if range() went up to exactly len(li) that this would be problematic? The programmer would need to explicitly subtract 1. This also follows the common trend of programmers preferring for(int i = 0; i < 10; i++) over for(int i = 0; i <= 9; i++).

If you are calling range with a start of 1 frequently, you might want to define your own function:

>>> def range1(start, end):
...     return range(start, end+1)
...
>>> range1(1, 10)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
2 of 11
100

Although there are some useful algorithmic explanations here, I think it may help to add some simple 'real life' reasoning as to why it works this way, which I have found useful when introducing the subject to young newcomers:

With something like 'range(1,10)' confusion can arise from thinking that pair of parameters represents the "start and end".

It is actually start and "stop".

Now, if it were the "end" value then, yes, you might expect that number would be included as the final entry in the sequence. But it is not the "end".

Others mistakenly call that parameter "count" because if you only ever use 'range(n)' then it does, of course, iterate 'n' times. This logic breaks down when you add the start parameter.

So the key point is to remember its name: "stop". That means it is the point at which, when reached, iteration will stop immediately. Not after that point.

So, while "start" does indeed represent the first value to be included, on reaching the "stop" value it 'breaks' rather than continuing to process 'that one as well' before stopping.

One analogy that I have used in explaining this to kids is that, ironically, it is better behaved than kids! It doesn't stop after it supposed to - it stops immediately without finishing what it was doing. (They get this ;) )

Another analogy - when you drive a car you don't pass a stop/yield/'give way' sign and end up with it sitting somewhere next to, or behind, your car. Technically you still haven't reached it when you do stop. It is not included in the 'things you passed on your journey'.

I hope some of that helps in explaining to Pythonitos/Pythonitas!

Discussions

How do you start a for loop at 1 instead of 0?
Hi! I'm working on a bot to reply with suggestions for common python problems. This might not be very helpful to fix your underlying issue, but here's what I noticed about your submission: You are looping over an object using something like for x in range(len(items)): foo(item[x]) This is simpler and less error prone written as for item in items: foo(item) If you DO need the indexes of the items, use the enumerate function like for idx, item in enumerate(items): foo(idx, item) More on reddit.com
๐ŸŒ r/learnpython
16
6
November 13, 2015
Understanding Range() function in python. [Level: Absolute Beginner]
You can think of range as returning a sequence of numbers. Since we use the syntax for in : to loop or iterate over a sequence, naturally we can put a range as the sequence. Does that help? More on reddit.com
๐ŸŒ r/learnpython
23
4
August 6, 2024
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
Allow `range(start, None, step)` for an endless range - Ideas - Discussions on Python.org
Currently, to iterate over finite arithmetic sequences of integers, range is used, as in: for i in range(10): print(i) For an infinite arithmetic sequence, there are a few approaches. One can replace the โ€˜10โ€™ with a long sequence of nines, write a generator function or just switch to a ... More on discuss.python.org
๐ŸŒ discuss.python.org
0
January 15, 2021
๐ŸŒ
AskPython
askpython.com โ€บ home โ€บ pythonic way to iterate through a range starting at 1
Pythonic Way to Iterate Through a Range Starting at 1 - AskPython
June 30, 2023 - The range function allows you to create a sequence of numbers with a particular step size. The step size is set to 1 by default. The starting value is set to 0 by default, and we just need to pass the ending value.
๐ŸŒ
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 - By default, it starts at 0 but we can specify 1 as the starting point. ... The range(1, 6) specifies a start of 1 and goes up to 5 (excluding 6 as range is non-inclusive), this is the simplest and most common way to start a loop at 1.
๐ŸŒ
Enki
enki.com โ€บ post โ€บ how-to-use-python-range-function
Enki | Blog - How to use Python Range Function
Using the range() with a step helps you manage how iterations happen. Starting at 1, this loop increments by 2, demonstrating how stepping works.
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ python โ€บ range-function
Python range() Function [Python Tutorial]
The Python range() function generates a sequence of numbers in a range. By default, range() starts at 0, increments by 1, and stops before a specified number.
๐ŸŒ
PYnative
pynative.com โ€บ home โ€บ python โ€บ python range() explained with examples
Python range() Function Explained with Examples
March 17, 2022 - Here, start = 0 and step = 1 as a default value. If you set the stop as a 0 or some negative value, then the range will return an empty sequence. If you want to start the range at 1 use range(1, 10).
Find elsewhere
๐ŸŒ
Coursera
coursera.org โ€บ tutorials โ€บ python-range
How to Use Range in Python | Coursera
Python range is a function that returns a sequence of numbers. By default, range returns a sequence that begins at 0 and increments in steps of 1. The range function only works with integers. Other data types like float numbers cannot be used.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ gloss_python_for_range.asp
Python Looping Through a Range
Python Examples Python Compiler ... ... 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....
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ methods โ€บ built-in โ€บ range
Python range() Function
The Python range() function generates a sequence of numbers. By default, the sequence starts at 0, increments by 1, and stops before the specified number.
๐ŸŒ
Stanford
web.stanford.edu โ€บ class โ€บ archive โ€บ cs โ€บ cs106a โ€บ cs106a.1204 โ€บ handouts โ€บ py-range.html
Python range() Function
The 3 parameter form begins with start number, up to but no including the stop number as usual. The difference is the "step" amount between numbers is now custom. Once the number is equal or goes beyond the stop, the range ends. As before, the stop number itself is always omitted. >>> list(range(0, 10, 2)) [0, 2, 4, 6, 8] >>> list(range(0, 10, 6)) [0, 6] >>> list(range(200, 800, 100)) [200, 300, 400, 500, 600, 700]
๐ŸŒ
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,
๐ŸŒ
Python Morsels
pythonmorsels.com โ€บ range
Python's range() function - Python Morsels
January 14, 2025 - So range can accept one argument (the stop value) where it starts at 0, and it stops just before that number. And range can also accept two arguments: a start value and a stop value. But range also accepts a third argument! The range function can accept an optional third argument: ... That third argument is the step value, which defaults to 1....
๐ŸŒ
Real Python
realpython.com โ€บ python-range
Python range(): Represent Numerical Ranges โ€“ Real Python
November 24, 2024 - It can be called with one, two, or three integer arguments to specify the start, stop, and step of the sequence. By default, it starts at 0 and increments by 1 until it reaches the stop value.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-range-function
Python range() function - GeeksforGeeks
Example: This example shows the use of range() to generate numbers starting from 0 up to (but not including) a given value. Python ยท for i in range(5): print(i, end=" ") Output ยท 0 1 2 3 4 ยท Explanation: range(5) generates numbers from 0 to 4 ยท i takes one value at a time from the generated sequence ยท
Published ย  1 month ago
๐ŸŒ
Python.org
discuss.python.org โ€บ ideas
Allow `range(start, None, step)` for an endless range - Ideas - Discussions on Python.org
January 15, 2021 - Currently, to iterate over finite arithmetic sequences of integers, range is used, as in: for i in range(10): print(i) For an infinite arithmetic sequence, there are a few approaches. One can replace the โ€˜10โ€™ with a long sequence of nines, write a generator function or just switch to a ...