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
Top answer
1 of 11
330

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!

🌐
W3Schools
w3schools.com › python › python_range.asp
Python range
range(10) returns a sequence of each number from 0 to 9. (The start argument, 0 is inclusive, and the stop argument, 10 is exclusive).
🌐
Python.org
discuss.python.org › ideas
`range()` with optional inclusive `stop` - Ideas - Discussions on Python.org
March 13, 2026 - I’m considering proposing an ... signature only—no new syntax or function. Summary: When inclusive=True, the stop value would be included in the sequence....
🌐
Flexiple
flexiple.com › python › inclusive-range-python
Inclusive range Python - What does this signify? | Flexiple - Flexiple
March 14, 2022 - Another method is to create a function which increments the range. This makes the Python range function inclusive.
🌐
Coursera
coursera.org › tutorials › python-range
How to Use Range in Python | Coursera
By default, range returns a sequence ... are three range parameters: start, stop, and step. Only stop is required. Range is not an inclusive function....
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-range-function
Python range() function - GeeksforGeeks
The range() function in Python is used to generate a sequence of integers within a specified range.
Published   March 10, 2026
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python – range() inclusive values
Python - range() Inclusive Values - Spark By {Examples}
May 31, 2024 - We know that range() function returns the range of values exclusive by default. That means if you provide stop as 100, It will return values from 0 to 99
🌐
Real Python
realpython.com › python-range
Python range(): Represent Numerical Ranges – Real Python
November 24, 2024 - This range represents counting down from five to zero, inclusive.
🌐
Fidelity
jobs.fidelity.com › home › principal engineer - python api development
Principal Engineer - Python API Development, Jersey City, NJ / Westlake, TX | Fidelity Careers
3 weeks ago - Placement in the range will vary based on job responsibilities and scope, geographic location, candidate’s relevant experience, and other factors.
🌐
Python documentation
docs.python.org › 3 › library › datetime.html
datetime — Basic date and time types
Between 1 and 12 inclusive. ... Between 1 and the number of days in the given month of the given year. ... In range(24).
🌐
BlackRock
careers.blackrock.com › job › new-york › equity-research-analyst-vice-president › 45831 › 94448313296
Equity Research Analyst, Vice President at BlackRock
Comfort working across structured and unstructured information, using tools (e.g., Python, SQL, or AI copilots) to interrogate data and pressure-test assumptions · Curiosity about how AI and data infrastructure are reshaping industries and how they can be applied to improve investment judgment over time For New York, NY Only the salary range for this position is USD$155,000.00 - USD$210,000.00 .
🌐
TikTok
lifeattiktok.com › search › 7630969539807185205
Software Development Engineer, Streaming Media
- Proficiency in at least one programming language: C, C++, Java, Python, Rust, or Go. Preferred Qualifications - Experience with CDN, multimedia systems, live streaming, or WebRTC. - Experience building or operating large-scale distributed systems. ... Compensation may vary outside of this range depending on a number of factors, including a candidate’s qualifications, skills, competencies and experience, and location.
🌐
Appdividend
appdividend.com › python-range-inclusive
What is an inclusive range in Python
August 7, 2025 - In Python, a range is typically ... value but excludes the end value. An inclusive range refers to a sequence of numbers where both the start and end values are included in the sequence....
🌐
JOB TODAY
jobtoday.com › us › jobs-python › ny_east-meadow
41 Best python Jobs in East Meadow, New York (April 2026) | JOB TODAY
Application Note: We are currently migrating to a new career system. Please apply using the link below on our new career page. Thank you for your patience and flexibility. Apply here: The expected salary range for this position is $95,000 to $105,000 annually.
🌐
Python Pool
pythonpool.com › home › tutorials › python range() inclusive stop: positive and negative steps
Python range() Inclusive Stop: Positive and Negative Steps
May 23, 2022 - To include an endpoint, use ... checking empty and stepped ranges explicitly. Inclusive ranges are a boundary policy: direction, step, and endpoint alignment all matter....
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › from
Array.from() - JavaScript | MDN
Python, Clojure, etc.) const range = (start, stop, step) => Array.from( { length: Math.ceil((stop - start) / step) }, (_, i) => start + i * step, ); // Generate a sequence of numbers from 0 (inclusive) to 5 (exclusive), incrementing by 1 range(0, 5, 1); // [0, 1, 2, 3, 4] // Generate a sequence ...