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.
e.g.,
s=" Python is a famous programming language" a=s.split() for temp in a: print(temp)
output- python is a famous programming language
e.g,
s="pythonpoint" l=list(s) print(l)
This is how we can split words in python.
Subscribe
Login
Please login to comment
0 Discussion