import time
start_time = time.perf_counter()
result_list = []
for x in range(100,1,-1):
num_list = []
for factor in range(x-1,1,-1):
num_list.append(x % factor)
if (0 in num_list)==False:
result_list.append(x)
end_time = time.perf_counter()
print(result_list)
print(f"程序用时为:{end_time-start_time} ")
[97, 89, 83, 79, 73, 71, 67, 61, 59, 53, 47, 43, 41, 37, 31, 29, 23, 19, 17, 13, 11, 7, 5, 3, 2, 1]
程序用时为:0.0005870000000000042