#this is the range() function
for a in range(7,1,-2): # range(start, stop, step)
#here 7 is maximum possible number
print(a, end=", ") #1 is minimum possible number but won't be included
# -2 is common diffrence between them
output:
7, 5, 3,
+-+--++-+-+-+-+-+-+--++-+--+-++-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+--+
#can be used a sequence of numbers
x = range(6)
print(x)
#Outputs 0 1 2 3 4 5
for i in range(start,finish ,step)
#gives range of numbers
#start is optional default is 0
#finish needed specifying when to stop
#step is incremetntaition of jump also optional
Below is the syntax of the range() function. range(start, stop[, step])
>>> for i in range(5):
... print(i)
...
0
1
2
3
4