Computer Science, asked by Ekene8372, 7 months ago

What is the purpose of range() function? Give one example.

Answers

Answered by priyatoshsil21022004
37

Answer:

The range() function is used to generate a sequence of numbers over time. At its simplest, it accepts an integer and returns a range object (a type of iterable). In Python 2, the range() returns a list which is not very efficient to handle large data. (optional) Starting point of the sequence

Explanation:

hope it helps u..

Answered by venugopalreddy0491
8

Answer:

One of the most common uses of the range() function is for iterating over a series of values in a for loop. This is particularly useful if you want to access each of the values in a list or array, or, for example, only every other value. In this example, the range() function is generating a sequence from 0 to 4 .

Similar questions
Math, 7 months ago
Math, 10 months ago