Explore these results from Bing
- See results only from w3schools.com
Try It Yourself
['welcome', 'to', 'the', 'jungle'] ...
Python String Methods
Python has a set of built-in methods that you can use on strings. Note: All string …
Split a string into a list where each word is a list item:
txt = "welcome to the jungle"x = txt.split()print(x)Definition and Usage
The split() method splits a string into alist.
Syntax
string.split(separator, maxsplit)More Examples
Split the string, using comma, followed by a space, as a separator:
txt = "hello, my name is Peter, I am 26 years old"x = txt.split(", ")print(x)Content Under CC-BY-SA licenseHow To Split a String using Python String split() Method - Python …
WebLearn how to use .split(), +, and .join() methods to manipulate strings in Python. See examples, explanations, and exercises on splitting, …
- Estimated Reading Time: 8 mins
WebPython String split() Method. A string can be split into substrings using the split(param)method. This method is part of the string object. The parameter is optional, but you can split on a specific string or character. Given a …
- People also ask
split() in Python - String Methods with Examples