【发布时间】:2016-07-10 20:42:35
【问题描述】:
我希望这个程序只接受 "yes ,"y", "Yes" 中的任何一个作为输入文本,但由于某种原因,当我输入其中一个时没有任何反应,并且下面的循环似乎没有运行:
import time
print ("Welcome to my first ever RPG! created 10/07/2016")
time.sleep(2)
begin = raw_input("Would you like to start the game?")
Start = False
if begin == ("yes" , "y" , "Yes" ):
Start == True
while Start == True:
player_name = raw_input("What would you like to name your character")
print ("welcome " + player_name.capitalize())
(PS:首选最简单的解决方案,我对python有点陌生)
【问题讨论】:
标签: python-2.7 input python-2.x