Random number python
import random for x in range (1 0): print random. randint (1, 21) 5, print Basically this code will generate a random number between 1 and 20, and then multiply that number by 5. So not only will every number printed be a multiple of 5, but the highest number that can be printed is 100 ( ).To generate random number in Python, randint() function is used. This function is defined in random module. random number python
The standard random module implements a random number generator. Usage is simple: import random print random. random(). This prints a random floating point number in the range [0, 1) (that is, between 0 and 1, including 0. 0 but always smaller than 1. 0).