擅长:python、mysql、java
<p>你的代码有点混乱,我会这样重写:</p>
<pre><code>def isPrime(num):
if num % 2 == 0:
return True
return False
n=1
while True:
if isPrime(n):
print n
cont = raw_input("Do you want to continue? (1,0) ")
if not bool(int(cont)):
break
n += 1
</code></pre>