The following code will print 10 pseudo-random integers between 1 and 100
import random
for x in range(10):
print random.randint(1,101)
For security or cryptographic uses, see the secrets module.https://docs.python.org/3/library/random.html
random.seed(a=None, version=2)random.randrange(start, stop[, step])random.randint(a, b)random.random()
沒有留言:
張貼留言