📜  字符串中的单词列表并根据辅助列表过滤它们 - Python 代码示例

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

代码示例1
common_words = frozenset(("if", "but", "and", "the", "when", "use", "to", "for"))
title = "When to use Python for web applications"
title_words = set(title.lower().split())
keywords = title_words.difference(common_words)
print(keywords)