编写此简单的python代码以检查密码。我正在尝试添加一个kill命令,但似乎无法弄清楚。
correct_password = "python123"
password = input("Enter Password: ")
while correct_password != password:
password = input("Try again: ")
if password = "q":
exit()
答案 0 :(得分:0)
您只需要使用=这样的符号 如果VARIABLE ==是
correct_password = "python123"
password = input("Enter Password: ")
while correct_password != password:
password = input("Try again: ")
if password == "q":
exit()
这是您的代码,没有错误。