Python raw_input()无限循环,带有if语句和while循环
我不知道怎么做循环,但有人告诉我了。下面是一个类似的代码:Python raw_input()无限循环,带有if语句和while循环,python,Python,我不知道怎么做循环,但有人告诉我了。下面是一个类似的代码: one = True two = False three = False typed_input = raw_input("Type here: ") #first if one == True and two == False and three == False: if typed_input == "blah": do something typed_input = raw_inp
one = True
two = False
three = False
typed_input = raw_input("Type here: ")
#first
if one == True and two == False and three == False:
if typed_input == "blah":
do something
typed_input = raw_input("Type here: ")
one = False
two = True
three = False
elif "the" in typed_input:
do something else
typed_input = raw_input("Type here: ")
one = False
two = True
three = False
顺便说一句,不要把这个拿下来,因为尽管它看起来像是一个副本,但这个问题似乎对我没有任何帮助。我需要一些更具体的东西。你可以做的是在一段时间内启动循环,然后你只需要复制两个输入检查,而不是让数百个检查来模拟对话。在外面做,然后在下一个缩进中做if-1-2-3,然后做你的聊天检查