How to split a word in python?
The split() method separates the string by the given separator and returns the lists of string.
By default, split() takes whitespace as a delimiter.
s=" Python is a famous programming language" a=s.split() for temp in a: print(temp)
output- python is a famous programming language
s="pythonpoint" l=list(s) print(l)
This is how we can split words in python.
Please login to comment
View all comments