Answers for "how to import random module in python"

1

how to import random module in python

# To import the random module in python, do the following

import random # This will import

# testing

print(random.randint(0, 3)) # This will print a random number from 0 to 3

# Hope this helps!!
Posted by: Guest on January-19-2022
0

import random python

random.choice
Posted by: Guest on November-01-2021

Code answers related to "how to import random module in python"

Python Answers by Framework

Browse Popular Code Answers by Language