How to use range() in Python

The built-in range() function is used to generate an immutable sequence of integers.

Solution for How to use range() in Python : You can use range() to generate an immutable sequence of integers Call range(stop) with stop as a specified number to return a sequence of integers from 0 to stop. By default, range() starts from 0, and increments by 1.

To specify the starting number, call range(start, stop) with start and stop as an integer to return a sequence of integers from start to stop.

a_range = range(1, 4)


how-to-use-range-in-python