python_输出100:200内的素数
sushu=[] for i in range(100,201): for j in range(2,i): if i%j==0: break if i==j+1: sushu.append(i) print(sushu) # 结果:[101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]
sushu=[] for i in range(100,201): for j in range(2,i): if i%j==0: break if i==j+1: sushu.append(i) print(sushu) # 结果:[101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]