# 随机生成10个【1,100】之间不同的整数。考察集合,随机数用random库 import random p = set() while len(p) < 10: p.add(random.randint(1, 100)) print(p)