📌  相关文章
📜  如果在列表 python 站点中从集合中删除单词:stackoverflow.com - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:48.622000             🧑  作者: Mango

代码示例1
query = 'What is hello'
stopwords = ['what', 'who', 'is', 'a', 'at', 'is', 'he']
querywords = query.split()

resultwords  = [word for word in querywords if word.lower() not in stopwords]
result = ' '.join(resultwords)

print(result)