# 判断是否是素数 def is_sushu(num): res=True for x in range(2,num-1): if num%x==0: res=False return res return res
# 打印出素数列表 print ([x for x in range(1000) if is_sushu(x)])
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn