Python Program to Concatenate Strings

Write a Python Program to Concatenate Strings with a practical example. This program allows users to enter two different strings. Next, we used the Arithmetic Operator + to concatenate those two strings. Refer to the Python Arithmetic Operators.

str1 = input("Please Enter the First  String : ")
str2 = input("Please Enter the Second String : ")

concat1 = str1 + str2
print("The Final String After Python String Concatenation = ", concat1)

concat2 = str1 + ' ' + str2
print("The Final After String Concatenation with Space = ", concat2)
Program to Concatenate Strings

If you are concatenating the string literals, then you can use the following approach. Both these Python approaches work means, with parentheses or without. Refer to the Python string article.

concat1 = 'Tutorial ' 'Gateway'
print("The Final String = ", concat1)

concat2 = ('Python ' 'Programming ' 'Examples')
print("The Final String = ", concat2)

String concatenation output

The Final String =  Tutorial Gateway
The Final String =  Python Programming Examples

Also Read