为什么从程序里面开始运行程序,运行不了?
import mathdef is_prime(number):
if number > 1:
if number == 2:
return True
if number % 2 == 0:
return False
for current in range(3, int(math.sqrt(number) + 1), 2):
if number % current == 0:
return False
return True
return False
def sumsu(num):
sum1=0
for i in range(2,num):
if is_prime(i):
sum1=sum1+i
return sum1
sumsu(2000000) #在shell输入却可以运行,奇怪 https://fishc.com.cn/thread-177243-1-1.html
页:
[1]