python“或”函数;我的代码出了什么问题?

时间:2016-04-30 13:02:21

标签: python function

这是我想要建立的游戏:

print "Hello! Welcome to LIGHT! Please choose a username to begin."
print "Username:",
username = raw_input() 
print "Very well! Nice to meet you, %s. Where would you like your journey to begin?" % username
print """
\t* (A) Goldnesse
\t* (B) Wildecrest
\t* (C) Foxview
\t* (D) Westwood
"""
place = raw_input("A, B, C, or D? ")

if place == "A" or "a": 
    print "Welcome to Goldnesse!"
else:
    pass

if place == "B" or "b":
    print "Welcome to Wildecrest!"
else:
    pass

if place == "C" or "c":
    print "Welcome to Foxview!"
else:
    pass

if place == "D" or "d":
    print "Welcome to Westwood!"
else:
    pass

每当我尝试在终端中运行它,并输入A,a,B或b等时,它会打印所有响应。像这样:

    A, B, C, or D? d
Welcome to Goldnesse!
Welcome to Wildecrest!
Welcome to Foxview!
Welcome to Westwood!

我的代码有问题吗?!谢谢。

0 个答案:

没有答案