Answers for "Splitting strings in Python without split()"

0

Splitting strings in Python without split()

sentence = 'This is a sentence'
word=""
for w in sentence :
    if w.isalpha():
        word=word+w

    elif not w.isalpha():
      print(word)
      word=""
print(word)
Posted by: Guest on May-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language