Let’s say you need to generate random numbers in Python. I need it once for an application that generates random numbers in order to create math problems to be solved by students. But being able to generate random numbers is useful in many other situations. In order to generate random numbers in Python we need to import the `random`

module.

If you just need a random number between 0.0 and 1.0 then just call `random.random()`

.

```
>>> import random
>>> random.random()
0.74002357942266106
>>> random.random()
0.07003308263110275
>>> random.random()
0.14104273470877104
```