Python raw\u input()带有if语句和while循环的无限循环

2024-04-25 08:06:42 发布

您现在位置: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_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

顺便说一句,不要把这个记下来,因为虽然它看起来像是一个副本,但这个问题似乎对我没有任何帮助。我需要更具体的东西。你知道吗


Tags: and代码falsetrueinputrawifhere
1条回答
网友
1楼 · 发布于 2024-04-25 08:06:42

你所能做的是在一段时间内启动你的循环,然后你只需要做你上面所做的两个输入跳棋复制,而不是有数百个他们只是为了模拟一个对话。在外面做一会儿,然后在下一个缩进中做if一二三,然后做你的聊天检查

相关问题 更多 >