How to Concatenate Two Strings in Python

Like the other data types, operations on strings are quite useful when we deal with some real-life applications.

Here we will talk about a simple operation on strings which is concatenation.

Before that, let’s have a glance at what strings are?

Strings are a sequence of characters that are denoted using inverted commas ”. They are immutable which means they cannot be changed once declared. The distinction between two strings can be understood using id().

Examples of a string are-

a=’Bill Gates’


In this article, we will discuss how we can concatenate two strings with the help of the given methods-

  1. Using ‘+’ operator.
  2. Using .format()
  3. Using join()
  4. Using % operator.

So, let’s get started…

  1. The first way which we will see is concatenating two strings using the ‘+’ operator. This operator merges or joins the two given strings.

In the program given below, we have declared six strings and then concatenated them using the ‘+’ operator and stored them in str7 and after that print that value.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store