Python, Software Development

Python 3 Split and Join Strings

Python Programming
Photo by Tomáš Malík from Pexels

This post shows how to split and join strings in Python 3.

Using Python 3.7.0.

Split Strings

By Space

The following codes split a string by space. This is the default behavior of the split function.

This outputs:

By other String

This outputs:

Join Strings

The way to join strings is to use the string object’s join function.

This outputs:

You Might Also Like