擅长:python、mysql、java
<p>你需要重组你的代码来得到你想要的。你知道吗</p>
<pre><code>pin1 = int(input("Please set a pin: "))
print("Welcome to Satan's Soul Bank, Enter ya pin!")
correct_pin = False
for i in range(3):
attempt = int(input("Please enter your pin number first"))
if attempt == pin1:
correct_pin = True
break
else:
print("Invalid PIN. {} attempts remain.".format(2 - i))
if correct_pin:
print("Select operation.")
print("1.Deposit Souls")
print("2.Withdraw Souls")
print("3.Check Soul balance")
choice = int(input("Enter choice(1/2/3):"))
else:
print ("Card Swallowed Contact SATAN")
</code></pre>
<p>我们循环3次,如果用户得到正确的pin码就退出,只有在pin码正确的情况下才提供进一步的选项。你知道吗</p>