文字列から単語のリスト
python 3系で,字列から単語のリストを作る
str="There are several words."
words=filter(lambda w:len(w)>0,str.split(' ')) # string list
>>> words
['There', 'are', 'several', 'words.']>>> str.split(' ')
となる.splitだけだと
> str.split(' ')
['There', 'are', 'several', '', '', '', '', '', 'words.']
と,空文字列''ができてしまう.