Skip to main content

Python Concatenate Strings Tutorial

DataCamp Team,
June 30, 2020 min read

Concatenating means obtaining a new string that contains both of the original strings. In Python, there are a few ways to concatenate or combine strings. The new string that is created is referred to as a string object.

In order to merge two strings into a single object, you may use the + operator.

Example of String Concatenation

In the below example, two original strings my_string1 and my_string2 are concatenated. To concatenate them, you use a plus operand to sum up both the strings, also specifying the space, generates the output as can be seen below.

Example on String Concatenation

To learn more about string manipulation, please see this video from our course, Regular Expressions in Python.

This content is taken from DataCamp’s Regular Expressions in Python course by Maria Eugenia Inzaugarat.

Learn More

Python String Tutorial

Python String Replace Tutorial

Python String format() Tutorial