Read Python Interview Questions and Answers for Beginners and Experienced

Python String Concatenation

In this Python tutorial, we will study Python String Concatenation with example. Strings are very useful in any programming language, so in Python Programming too.  Below we will see how to concatenate two or more Strings in Python.

In Python, Strings can be concatenate with Plus sign +. Let’s see below Python String Concatenation example


#Python String concatenation Example

str1="Python tutorial "
str2="for beginners"




Python tutorial for beginners



  • Here str1 and str2 are two String when we concatenate str1 and str2 with plus + sign, these strings will merge into one and we store that String into str3.
  • String str3 will also be a String, you can check this by using type() function of Python. when you will write print(type(str3)) result will be <class 'str'>

we can only concatenate Strings using plus operator. If we concatenate String with Integer  using plus, It will throw error.

#Python String concatenation Example

str1="Python tutorial "



TypeError: must be str, not int

So, In this Python example series, we study that how two strings in Python can be concatenated.