-3
程序列出了從1到100的素數,但是在運行時我得到「print p」的語法錯誤。 什麼錯?Python的幫助!我遇到了一個我不知道如何解決的語法錯誤。使用版本3.4.1
for p in range(2, n+1):
for i in range(2, p):
if p % i == 0:
break
else:
print p
print ("Done")
更多信息:https://docs.python.org/release/3.0.1/whatsnew/3.0.html#print-is-a-function – rosshamish 2014-11-06 04:48:45