Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert sentence to list of words python

# Python3 program to Convert single
# indexed list into multiple indexed list
 
def convert(lst):
    return ([i for item in lst for i in item.split()])
     
# Driver code
lst =  ['Geeksforgeeks is a portal for geeks']
print( convert(lst))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #convert #sentence #list #words #python
ADD COMMENT
Topic
Name
7+7 =