KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

How can you use the randrange() function in your program?

  1. By importing the math module
  2. By importing the random module
  3. By importing the statistics module
  4. By importing the datetime module

Python Functions

1 Like

Answer

By importing the random module

Reason — The randrange() function belongs to the random module. It is used to generate random numbers from a given range. Therefore, to use randrange() in a Python program, the random module must be imported.

Answered By

3 Likes


Related Questions