random
# from xxx import xxxx # from 老男孩 import alex # 导入一个具体的功能 # import 老男孩 # 导入整个模块 # import random # print(random.randint(10,20)) # # from random import randint # print(randint(10,20)) import random # print(random.randint(10,20)) # 随机整数 # print(random.random()) # python中所有随机数的根 随机小数 0-1 # # print(random.uniform(10,20)) # 10-20的随机小数 # lst = ["宝宝", "宝强", "宝浪", "包拯"] # random.shuffle(lst) # 随机打乱顺序 # print(lst) # 从列表中随机选择一个 # print(random.choice(["林志玲", "刘一菲", "王昭君", "艾米", "宝宝"])) # print(random.sample(["林志玲", "刘一菲", "王昭君", "艾米", "宝宝"], 3))