remove words from set if in list python site 3astackoverflow com

Solutions on MaxInterview for remove words from set if in list python site 3astackoverflow com by the best coders in the world

showing results for - "remove words from set if in list python site 3astackoverflow com"
Gabriel
24 Mar 2020
1query = 'What is hello'
2stopwords = ['what', 'who', 'is', 'a', 'at', 'is', 'he']
3querywords = query.split()
4
5resultwords  = [word for word in querywords if word.lower() not in stopwords]
6result = ' '.join(resultwords)
7
8print(result)
similar questions