タグ付けされた質問 「text-segmentation」

9
文字列をリストに分割する方法は?
Python関数で文を分割し(入力)、各単語をリストに格納します。現在のコードでは文を分割していますが、単語をリストとして保存していません。それ、どうやったら出来るの? def split_line(text): # split the text words = text.split() # for each word in the line: for word in words: # print the word print(words)

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.