31  range function

range function is similar to mathematical notation [start,end). Therefore upper limit is not included.

see output of following code examples:

n = 5
for x in range(n):
    print(x)

for x in range(1,n):
    print(x)


for x in range(3,n):
    print(x)

31.1 Other Tutorials

https://realpython.com/python-range/