I have a script that has a list of possible words, and an input, then checks for the words in the input but it only checks for the specific word, and I’m not sure how to integrate .lower() in it.
term = ["test1", "test2"]
raw_input = input()
if all(Variable in raw_input for Variable in term):
print("Both words were found")
else:
print("Couldn't find required words")
But I’d like to add a .lower() I’ve tried but can’t find a way. Thanks
>Solution :
I hope this is what you are looking for.
term = ["test1", "test2"]
raw_input = input()
# check if all terms are in the input string including lower and upper case
if all(x.lower() in raw_input.lower() for x in term):
print("Both words were found")
else:
print("Couldn't find required words")