I am trying to find if the words/string in the list are present in a given sentence.
sentence = 'The total number of cases in germany is equal to the inital cases from china'
listA = []
listA.append('equal to')
listA.append('good')
listA.append('case')
for item in listA:
if item in sentence.lower().strip():
print('success')
else:
print('Not Present')
I also tried with
if item in sentence.lower():
and
if item in sentence.lower().split():
But, this captures also the phrase cases
or does not work for phrases