【发布时间】:2011-07-22 21:53:29
【问题描述】:
NameError: 名称“Brandon”未定义
我在 Python 2.7.2 中有一个简单的用户名/密码程序,并且不断收到这个愚蠢的错误消息。
这是我的代码:
Username = input ("Please enter your username: ")
if Username == brandon:
password = input ("Correct! Please enter password: ")
if password == 42:
print "Access granted!"
else:
print "Wrong Password!"
else:
print "Wrong username"
【问题讨论】:
标签: python