Concept

Random Module

To use this module, you must import random at the top of your code.

This module is primarily used to generate random numbers.

Here are example functions from this module,

  • random.randrange() returns a random number within the given range
  • random.randint() returns a random number within the given range
  • random.random() returns a float between 0 and 1
  • random.uniform() returns a float between two given parameters

0

1

Updated 2021-08-09

Tags

Python Programming Language

Data Science