生成随机数
import random
a = random.randint(12, 20)
b = random.random()
c = random.uniform(0, 20)
d= random.randrange(10, 100, 2)
print(d)
print('-----------------')
print (random.choice("Pythontab.com"))
print (random.choice(["python", "tab", "com"]))
print (random.choice(("python", "tab", "com")))
print('-----------------')
list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
random.shuffle(list)
print (list)
print('-----------------')
list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
slice = random.sample(list, 5)
print (slice)
print (list)