How to use lists in conditionals
问题 I asked a question a couple of hours ago, but it got closed as a duplicate. I was asking if I could use the index of lists to validate answers. This was my original code: message = input("Problem: ") for item in keyword_list: if item in message: if item == "screen" or item == "cracked" or item == "blank": subp.call("screen.txt", shell=True) ...and keyword_list: keyword_list = ["screen", "cracked", "blank"] etc.... I got told (as an answer to the question) to do this instead: message = input(