In a range(start, end) function in python, why the end value is excluded
print(0,6) # prints numbers from 0 to 5 and the end value 6 is exlcuded
I just want to know why the range function is designed in such a way. Is there any specific reason?
In a range(start, end) function in python, why the end value is excluded
print(0,6) # prints numbers from 0 to 5 and the end value 6 is exlcuded
I just want to know why the range function is designed in such a way. Is there any specific reason?
If you just use an end value, you get that many numbers.
>>> range(6)
[0, 1, 2, 3, 4, 5]
>>> len(range(6))
6