Range function is used to specify the range of sequence of number between given values
Syntax : range(start,stop,step)
That means start indicates starting value of a range i.e, inclusive , stop indicates end value of range i.e, exclusive, step is difference value.
Example: for i in range(1,6,2):
print(i)
it will return 1 3 5 values
2 Likes
Correct keep practicing
The range () is an in-built function in Python.
It returns a sequence of numbers starting from zero and increment by 1 by default and stops before the given number.
x = range(5)
for n in x:
print(n)
OutPut
1
2
3
4
1 Like