Python String Concatenation | Combine Strings

The string is an object in python, some cases you need a combined string. The one way to do it is Python String Concatenation with a ‘ + ” operator.  In a case where you want a merge a 2 string and store value in another variable then use new_String=  first_string + second_string. Python provides several ways to concatenate strings.

Python String Concatenation | Combine Strings example

Ways to Python String Concatenation

  • Plus – using ‘+’ operator
  • Assign – using ‘+=’ operator
  • Using % operator
  • Multiple copies -Using * operator
  • join() Function – For iterators


Simple syntax for string concatenation used ‘+’ operator.


Here are 5 ways with an example of Python String Concatenation :

Using ‘+’ operator

Output: EyeHunt Tutorial

Using ‘+=’ operator

Output: EyeHunt Tutorial

Using % operator

Output: Python Tutorial

Using * operator

*  Creates new strings, concatenating multiple copies of the same string.

Output : AbcAbcAbc

join() Function 

Python Join is a String function (method) and it returns a string, where the elements of the sequence have been joined by string separator.

Read this tutorial for complete detail and examples  – Python Join Function | Join Strings

Output: EyeHunt, Tutorial, python

QA: Interview Questions

# Does int (number) can be Concatenation with string in Python?

Answers: No, Python can’t concatenate a strings and integer (numbers). They both are separate types of objects in python. So, if you want to merge it, you have to convert the integer to a string.

It will throw an error – TypeError: can only concatenate str (not "int") to str

Note : This example (Project) is developed in PyCharm 2018.2 (Community Edition)
JRE: 1.8.0
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6

Python 3.7

All Examples of Python String Concatenation are in Python 3, so it may change its different from python 2 or upgraded versions.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.