This achieved with importing the random module,it is the module that is used to generate random numbers.
Syntax:
import random
random.random # returns the floating point random number between the range of [0,1].