天天看點

python---字元串中出現單詞次數

python—字元串中出現單詞次數

>>> g
'i am xu wei bo,this is best men'
>>> print [i for i in g.split() if i]
['i', 'am', 'xu', 'wei', 'bo,this', 'is', 'best', 'men']
>>>