Here is a simple program to demonstrate string concatenation:# Python program to concatenate two stringsstr1 = input(“Enter the first string: “) # Input string 1str2 = input(“Enter the second string: “) # Input string 2 # Concatenating strings using the + operatorconcatenated string = str1 + str2 print(“Concatenated string:”, concatenated string)
While the + operator is commonly used, there are other methods to concatenate strings in Python:Using join() Method:
# Using join to concatenate stringsstr1 = “Hello”str2 = “World”result = “”.join([str1, str2])print(“Concatenated string:”, result)