Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有段落包含“我有一本很好的 python 书,所以会成为 pythonist”我的目标是只搜索“python”而不是 pythonist 我怎么能用 python 来做它并且前后不带任何额外的字符
'python'这将通过用空格分割所有单词来确定是否与单词完全匹配。
'python'
>>> text = "I have a good python book so will become pythonist" >>> 'python' in text.split() True