您好我是一个新的Python 2.7.3,我试图编写一个自动退出条款后两个if语句。为什么我不能得到一个退出命令工作
import os
password = "Anhur"
attempt = 0
while (password != "Anhur") and (attempt <= 3):
password = raw_input("Password: ")
attempt = attempt + 1
if attempt == 3:
print ("You have used all your attempts, the system will now close..")
print (" The shifting sands have ended you.")
break
if (password == "Anhur"):
print ("You conquered the sands")
os.exit(1)
这是我得到的,但它似乎从来没有工作我试图sys.exit(0)以及。任何帮助将是美好的。