«text-segmentation» etiketlenmiş sorular

9
Bir dizeyi listeye nasıl bölebilirim?
Python fonksiyonumun bir cümle (giriş) bölmesini ve her kelimeyi bir listede saklamasını istiyorum. Geçerli kodum cümleyi böler, ancak kelimeleri liste olarak saklamaz. Bunu nasıl yaparım? 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)

Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.