🌐
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’s the Difference Between Split and Splitlines?
The split separates the string into the substrings depending on the delimiter. The split lines ensure the string's split so that each element represents a new line.
🌐
simplilearn.com
simplilearn.com › home › resources › software development › python split() function: how to use split() in python
Python split() Function: Syntax, and Usage Guide
What is the Impact of maxsplit on Split Results?
The maxsplit decides the number of splits to be formed of the substring from the string.
🌐
simplilearn.com
simplilearn.com › home › resources › software development › python split() function: how to use split() in python
Python split() Function: Syntax, and Usage Guide
🌐
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)
🌐
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:
🌐
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)
🌐
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....
🌐
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(' ...
🌐
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.