Python:从文本中选择单词

Python:从文本中选择单词,python,Python,所以我在做一个小项目时遇到了问题,问题在第10行和第18行。不知什么原因我不能触发第48行,我不明白为什么?我还有另一个问题,那就是为什么当我输入程序不应该承认的随机内容时,比如当程序说“请陈述你的问题”,而我要输入“iajsdb”时,为什么程序不到此结束?相反,它会选择一个结果,比如“互联网速度慢还是手机整体速度慢?”。还有,是的,我知道代码非常混乱,这是我写的一个片段,如果需要更多来解决问题,那么我很乐意发布更多。非常感谢 #Twig2 (iPhone/2g/problem/

所以我在做一个小项目时遇到了问题,问题在第10行和第18行。不知什么原因我不能触发第48行,我不明白为什么?我还有另一个问题,那就是为什么当我输入程序不应该承认的随机内容时,比如当程序说“请陈述你的问题”,而我要输入“iajsdb”时,为什么程序不到此结束?相反,它会选择一个结果,比如“互联网速度慢还是手机整体速度慢?”。还有,是的,我知道代码非常混乱,这是我写的一个片段,如果需要更多来解决问题,那么我很乐意发布更多。非常感谢

        #Twig2 (iPhone/2g/problem/wet)
    elif "wet" in iproblem2g.lower():
        print ("The chances that your phone will recover from water damage is extremly minimal. You may wish to go to a proffesional and see if any data can be restored, otehrwise you will most likely need to buy a new phone.")
        applestore = raw_input ("Would you like to find an Apple store near you? ")
        if "yes" or "sure" or "okay" in applestore:
            webbrowser.open("http://www.apple.com/retail/")
        else:
            print("Troubleshooting complete.")

    elif "no wifi" or "can't connect" or "cant connect" in iproblem2g.lower():
        print("If you cannot connect to your local wifi network then follow these steps:")
        print("1. Make sure you have a strong signal")
        print("2. Make sure your wifi is actually on in your settings")
        print("3. Make sure your wifi network is visible to the public and not invisible.")
        print("If none of these steps helped then consider going to your local phone repair shop and getting it checked up.")

            #Twig4 (iPhone/problem/slow)
    elif "slow" or "lag" in iproblem2g.lower():
        slow = raw_input ("Is the internet slow or the phone overall? ")
        if "net" or "web" in slow:
            print ("Make sure that your slow connection isn't caused by a weak signal.")
            nettips = raw_input ("Would you like to be redirected to a page with tips to speed up your internet? ")

如果使用不正确,则说明您没有使用
。你应使用:

elif "no wifi" in iproblem2g.lower() or "can't connect"  in iproblem2g.lower() or "cant connect" in iproblem2g.lower():
elif "slow" in iproblem2g.lower() or "lag" in iproblem2g.lower():
依此类推(重复该条件,
使其始终计算为
,而不考虑您的输入)