SORU
13 NİSAN 2009, PAZARTESİ


Python bir liste içine dize bölmek

Python benim işlevi bir cümle (giriş) bölünmüş ve bir listedeki her kelimeyi saklamak istiyorum. Şimdiye kadar yazdığım kodu cümle böler, ama bir liste gibi sözler saklamaz. Nasıl yapabilirim?

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)

CEVAP
13 NİSAN 2009, PAZARTESİ


words = text.split()

bu liste

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • BuzzFeedVideo

    BuzzFeedVide

    10 AĞUSTOS 2011
  • Felice Musique

    Felice Musiq

    22 NİSAN 2014
  • Whizzpopping

    Whizzpopping

    10 Kasım 2005