def isprime(n): for i in range(2, n): if n % i == 0: return 0 return 1 n = int(input("请输入一个数据:")) value_set = set() for i in range(2, n): if isprime(i) == 1: value_set.add(i) print(value_set)