您好我是一個新的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)以及。任何幫助將是美好的。