Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)
Comment

PREVIOUS NEXT
Code Example
Python :: slicing in python 
Python :: divide every element in numpy array 
Python :: remove file os python 
Python :: Replace all the empty rows in the column with the value that you have identified 
Python :: sum of array in python 
Python :: how to install os module in python 
Python :: dataframe check for nan in iterrows 
Python :: how to convert integer to binary string python 
Python :: pandas datetime to unix timestamp 
Python :: python convert string to list of dictionaries 
Python :: np matrix drop zero column 
Python :: python regular expressions 
Python :: making your own range function in python 
Python :: how take in put as list in integer value 
Python :: how to redirect user in flask response python 
Python :: raw input py 
Python :: python sort list by custom function 
Python :: print(int()) 
Python :: df groupby 
Python :: python trim 
Python :: namedtuple python 
Python :: character in string python 
Python :: how to use drf permission class with class method actions 
Python :: jupyterlab interactive plot 
Python :: python loop backward 
Python :: pie chart maptlotlib larger labels 
Python :: how to join tables in python 
Python :: python write into file at position 
Python :: intersection python dict 
Python :: how to read first column of csv intro a list python 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =