Robotics & Artificial Intelligence

The purpose of the range function in a for loop is to ……………

  1. create a list of numbers
  2. define the start and end of the loop
  3. generate a sequence of numbers
  4. specify the step size of the loop

Python Control Flow

3 Likes

Answer

generate a sequence of numbers

Reason — The range() function is a built-in function that generates a sequence of integer numbers based on the initial value, stop value and update parameters. This sequence is then used by the for loop for iteration.

Answered By

2 Likes


Related Questions