226k views
3 votes
Range is an example of a ______________.



Python

1 Answer

3 votes

The question isn't clear enough. I feel the question wants us to answer what category or type the range is in python.

Answer:

Range is a Function in python

Step-by-step explanation:

Range is an example of a function in python. The range function takes its own argument when called. The range function can take up to 3 arguments but atleast 1 argument should be stated when it is called.

When range is called as ;

range(4) ;

This specifies the stop argument ; this evaluates as range of values from 0 up to 3 (4 is excluded) in the interval of 1

Output will be : 0, 1, 2, 3

range(4, 8) ;

This specifies the start and stop argument ; this evaluates as range of values from 4 up to 7 (8 is excluded) in the interval of 1

Output will be : 4, 5, 6, 7

range(4, 8, 2) ;

This specifies the start, stop and interval argument ; this evaluates as range of values from 4 up to 7 (8 is excluded) in the interval of 2

Output will be : 4, 6

User Ishan Bhatt
by
5.6k points