What is range functon..... its syntax and example

The range() function returns a sequence of numbers between the give range
syntax: range(start, stop, step)
example:
num1 = range(2, 5)
print(num1) it will return 2,3,4
num2 = range(2,10,2)
print(num2) it will return 2,4,6,8

2 Likes

Keep practicing well done @souravkrsheel99

1 Like