Python Random Number
Python does not have a
random() function to
make a random number, but Python has a built-in module called
random that can be used to make random numbers:
Import the random module, and display a random number between 1 and 9:
Try it Yourself »
In our Random Module Reference you will learn more about the Random module.