第26742题 单选题
关于求1到N之间所有质数的Python代码,下列说法错误的是?

给出的求1到N之间所有质数的Python代码如下:

def is_prime(N):
    if N <= 1:return False
    finish_number = int(N ** 0.5) + 1

    for i in range(2, finish_number):
        if N % i == 0:
            return False
    return True

#列出1-N之间所有质数
N = int(input())
print([n for n in range(1,N+1) if is_prime(n)])
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析