擅长:python、mysql、java
<p><code>break</code>语句是无条件执行的,因此您永远不会重复循环</p>
<p>它应该只在<code>found_username</code>为真时执行,所以将它放在最后<code>if</code>的<code>else:</code>块中</p>
<pre><code> if not found_username:
print("Username and or password do not exist!")
count += 1
if count == 3:
print("Attempts exceeded")
else:
break
</code></pre>