擅长:python、mysql、java
<p>循环运行不到10次,因为如果答案正确,问题变量将增加两次。两条信息(“正确”/“不正确”)都会打印出来。你的代码需要'else':</p>
<pre><code>if user_answer==expected_answer:
print ('This is correct!')
print ("Your score so far is",score,"out of 10")
question=question+1
time.sleep(2)
else:
print ('This is incorrect!')
question=question+1
time.sleep(2)
</code></pre>
<p>但是考虑重写安东·埃皮钦所说的整个代码!你知道吗</p>