๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_string_split.asp
Python String split() Method
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Training ... The split() method splits a string into a list.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-string-split
Python split() Method - GeeksforGeeks
July 1, 2026 - Explanation: s.split(',') splits the string s at every comma and returns a list of the parts ['one', 'two', 'three'].
People also ask

What is the difference between split() and split(' ')?
This is a common point of confusion. The default split() splits on any sequence of whitespace and discards empty strings. In contrast, split(' ') splits only on the single space character. This means that if you have multiple spaces in a row, split(' ') will produce empty strings in your list. For example, 'hello world'.split() returns ['hello', 'world'], while 'hello world'.split(' ') returns ['hello', '', 'world'].
๐ŸŒ
knowledgehut.com
knowledgehut.com โ€บ home โ€บ blog โ€บ data science โ€บ python split() function: syntax, parameters, examples
Python Split() Function: Examples, Methods & Practical Tips
What is the return type of the split() function?
The split() function always returns a list of strings. This is because the purpose of the function is to create a collection of the substrings that result from the split. Even if the separator is not found in the string, the function will still return a list containing a single element: the original, unmodified string.
๐ŸŒ
knowledgehut.com
knowledgehut.com โ€บ home โ€บ blog โ€บ data science โ€บ python split() function: syntax, parameters, examples
Python Split() Function: Examples, Methods & Practical Tips
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ methods โ€บ string โ€บ split
Python String split()
The split() method breaks down a string into a list of substrings using a chosen separator. In this tutorial, we will learn about the Python String split() method with the help of examples.
๐ŸŒ
Hyperskill
hyperskill.org โ€บ university โ€บ python โ€บ split-in-python
Python split(): Split Strings by Delimiter with Examples
June 5, 2026 - The delimiter can be any character or substring that you want to use as a separator. The function searches for occurrences of the delimiter within the string and breaks it down at each occurrence. # Using whitespace as a delimiter text = "Hello World! Welcome to Python!" result = text.split() ...
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ python โ€บ string-split-method
Learn Python's String Split Method, Simplify Text Processing
Start your coding journey with Python. Learn basics, data types, control flow, and more ... 1. Split by Whitespace (Default): If you call .split() with no arguments, it splits the string by any sequence of whitespace (spaces, tabs, newlines) and discards empty strings.
๐ŸŒ
KnowledgeHut
knowledgehut.com โ€บ home โ€บ blog โ€บ data science โ€บ python split() function: syntax, parameters, examples
Python Split() Function: Examples, Methods & Practical Tips
July 6, 2026 - If you only need to split a string into three parts based on the first or last occurrence of a separator, partition() is a great choice. It always returns a tuple of three elements: The part before the separator. The separator itself. The part after the separator. Python email = "contact@example.com" parts = email.partition('@') print(parts)
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-split-a-string-in-python
Python .split() โ€“ Splitting a String in Python
September 8, 2022 - In the example above, I set the maxsplit to 1, and a list was created with two list items. I specified that the list should split when it encounters one dot. Once it encountered one dot, the operation would end, and the rest of the string would be a list item on its own. And there you have it! You now know how to split a string in Python using the .split() method.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-string-split
Python String split() - GeeksforGeeks
April 2, 2025 - In this article, we'll look at different ways to split and parse strings in Python. Let's understand this with the help of a basic example:Pythons = "geeks,for,geeks" # Split the string by commas res = s.split(',') # Parse the list and print each element for item in res: print(item)Outputgeeks for g
Find elsewhere
๐ŸŒ
Simplilearn
simplilearn.com โ€บ home โ€บ resources โ€บ software development โ€บ python split() function: how to use split() in python
Python split() Function: Syntax, and Usage Guide
July 31, 2025 - The split() function in Python can be used to split a given string or a line by specifying one of the substrings of the given string as the delimiter.
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
๐ŸŒ
PythonForBeginners
pythonforbeginners.com โ€บ home โ€บ how to use split in python
How to use Split in Python - PythonForBeginners.com
January 30, 2021 - As you can see from this code, the function splits our original string which includes three colors and then stores each variable in a separate string. This leaves us with three strings of โ€œaโ€, โ€œbโ€, and โ€œcโ€. Then, when you ask the interpreter to spit out the variables stored in these strings, you get the appropriate color. Pretty neat, no? Itโ€™s also extremely useful when youโ€™re working extensively with strings and variables. Letโ€™s look at another example.
๐ŸŒ
Real Python
realpython.com โ€บ python-split-string
How to Split a String in Python โ€“ Real Python
October 22, 2025 - By passing a comma (",") as the argument to sep, you instruct Python to use commas as the delimiter for splitting. As a result, .split() separates the string into a list of individual names. Note that .split() doesnโ€™t include the delimiter in the output. To consider another example, imagine that you have a line from a CSV file that contains product information:
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ python-string-split
Python String Split() Method | DigitalOcean
April 17, 2024 - Letโ€™s look at a simple example where a string will be split into a list based on the specified delimiter. s = 'Python is Nice' # simple string split example str_list = s.split(sep=' ') print(str_list)
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ string_split.htm
Python String split() Method
str = "Line1-abcdef \nLine2-abc \nLine4-abcd"; print(str.split( )) print(str.split(' ', -1)) When we run above program, it produces following result. For the first case, even the other delimiters, like line separators (\n), are removed. ['Line1-abcdef', 'Line2-abc', 'Line4-abcd'] ['Line1-abcdef', '\nLine2-abc', '\nLine4-abcd'] Well-known delimiters are passed as arguments to the method, to obtain the result value as the list of lines separated. In this example, we take two strings as input; both containing delimiters....
๐ŸŒ
PyTutorial
pytutorial.com โ€บ python-split-function-guide-usage-examples
PyTutorial | Python Split Function Guide: Usage & Examples
February 5, 2026 - # Example 2: Splitting by a comma data = "apple,banana,cherry,date" fruits = data.split(",") print(fruits) # Example 3: Splitting by a hyphen record = "2024-04-10-Log-Entry" parts = record.split("-") print(parts)
๐ŸŒ
Python Reference
python-reference.readthedocs.io โ€บ en โ€บ latest โ€บ docs โ€บ str โ€บ split.html
split โ€” Python Reference (The Right Way) 0.1 documentation
>>> ' a b c '.split() ['a', 'b', 'c'] >>> ' a b c '.split(None) ['a', 'b', 'c'] >>> ' a b c '.split(' ', 1) ['', 'a b c '] >>> ' a b c '.split(' ', 2) ['', 'a', 'b c '] >>> ' a b c '.split(' ', 3) ['', 'a', 'b', 'c '] >>> ' a b c '.split(' ', 4) ['', 'a', 'b', 'c', ''] >>> ' a b c '.split(' ...
๐ŸŒ
BitDegree
bitdegree.org โ€บ learn โ€บ python-split
Python split() Function: Learn to Split String Variables
October 3, 2019 - One of the easiest examples of how to divide Python strings with split() is to assign no parameters and break down a string of text into individual words:
๐ŸŒ
IONOS
ionos.com โ€บ digital guide โ€บ websites โ€บ web development โ€บ python split
How to split strings with Python split - IONOS
February 1, 2023 - This is the code: colors = "blue, red, yellow, orange" print(colors.split(", ", 2)) ... While the default variant is to split using commas or spaces, you can also split strings within specific words.
๐ŸŒ
Great Learning
mygreatlearning.com โ€บ blog โ€บ it/software development โ€บ python string split() method
Python String split() Method
May 28, 2026 - By default, it splits the string by whitespace, but you can specify any delimiter, such as a comma, semicolon, or custom character. ... The method returns a list of substrings. ... In this course, you will learn the fundamentals of Python: from basic syntax to mastering data structures, loops, and functions.