for n in range(2,10):
for x in range(2,n):
if n%x ==0:
print(n,'equals',x,'*',n//x)
break
else:
#loop fell through without finding a facter
print(n,"is a prime number")
程序中的break对应的是上面的if还是for?
转载于:https://www.cnblogs.com/qjmj/p/6728560.html
for n in range(2,10):
for x in range(2,n):
if n%x ==0:
print(n,'equals',x,'*',n//x)
break
else:
#loop fell through without finding a facter
print(n,"is a prime number")
程序中的break对应的是上面的if还是for?
转载于:https://www.cnblogs.com/qjmj/p/6728560.html