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

  • Charles Nesson

    Charles Ness

    27 NİSAN 2006
  • jkimisyellow...ish

    jkimisyellow

    8 Temmuz 2009
  • Ordetta Price

    Ordetta Pric

    12 EYLÜL 2011