# Syntax - range(start, stop, step) - you must use integers, floats cannot be used
for i in range(3):
print(i)
# output - automatically taken start = 0 and step = 1, we have given stop = 3 (excluding 3)
for i in range(0, 4):
print(i)
# output - We have given start = 0 and stop = 4 (excluding 4), automatically taken step =1
for i in range(0, 5, 2):
print(i)
# output - We have given start = 0, stop = 5 (excluding 5), step = 2
for i in range(0, -4, -1):
print(i)
# output - We can go even backwards and also to negative numbers
for i in range([start], stop[, step])
#Python range() example
print("Numbers from range 0 to 6")
for i in range(6):
print(i, end=', ')
for a in range(1,10):
print(a)
print(type(range(10)))
# Output <class 'range'>