I have sentence
and list
look like this
sentence = 'hi how is the high school'
check_words = [
'me',
'you',
'hi',
]
now I want to check the sentence and remove the check_words
items in sentence
the output should be look like this
sentence = 'how is the high school'
but when I use this code it's remove the extra hi
in high
this is the code
temp = sentence.split()
for k in temp:
if k in check_Words:
sentence = sentence.replace(k, '')