【发布时间】:2014-06-03 12:45:28
【问题描述】:
我正在使用 Python 并想知道如何编写一个要求 UN 和密码的程序。我正在使用“while 循环”的教程。
对于Command和Input1和Input2,为什么它们显示变量等于“”
他们显示:
name = raw_input("What is your UserName: ")
password = raw_input("What is your Password: ")
print "To lock your computer type lock."
command = ""
input1 = ""
input2 = ""
while command != "lock":
command = raw_input("What is your command: ")
while input1 != name:
input1 = raw_input("What is your username: ")

【问题讨论】: