复制代码 代码如下:
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)])
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8