How to Combine Two String Variables in Python

In this tutorial, learn how to combine two string variables in Python. The short answer is: use the plus(+) operator to concatenate two string variable. Concatenation is the process of combining two or more string variables.

However, we will learn about combining only two variables with the example given here. You can combine the string enclosed within a single quote or double quote. Both quotes are the way to define a string. You may also like to learn how to create a string variable in Python.

How to Combine Two String Variables in Python

If you want to concatenate or combine two string variables in Python. You have to use the plus(+) operator with the string variables.

This is the addition of the two string variables. But it’s not a mathematical calculation or any other formation of evaluation. This just places the string with each other with the first-string followed by the second.

Output

How are you?I am fine thank you.

The output of the above string gives the combined output. You can place the two string variables with the plus(+) operator directly to the print statement. Also, you can store the combination in the third-string variable. After combination, you have to use the print statement to print the concatenated string in Python.

You may also like to read

I hope you like this tutorial on how to combine two string variables in Python.

References