📜  python代码示例中的随机数

📅  最后修改于: 2022-03-11 14:45:15.927000             🧑  作者: Mango

代码示例6
#import random 
import random

names = ['Harry', 'John', 'Smith', 'Larry']

#print random name from names
print(random.choice(names))

#print random integer in a range of numbers
print(random.randint(1, 100)