How to split a word in python?
![](https://pythonpoint.net/wp-content/uploads/2020/12/Green-and-Black-Illustrated-Video-Game-Controller-Vector-YouTube-Channel-Cover-9-1024x576.jpg)
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)
![](https://pythonpoint.net/wp-content/uploads/2020/12/Screenshot-979-1024x513.png)
This is how we can split words in python.
Subscribe
Login
Please login to comment
0 Discussion