Although random comes with the python itself (you don't need to install it)
But to use it you need to import it
import random # you need to import random
def roll_dice(num):
return random.randint(1, num)
roll_dice(6)
Import means: The Python code in one of the module gains access to the code in another module by the process of importing it.
If you want to know more about the Data Science then do check out the following Data Science which will help you in understanding Data Science from scratch