Topics covered in this story:
Photo by Author
Concatenation is done by +
operator. Concatenation is supported by sequence data types(string, list, tuple). Concatenation is done between the **same data types **only.
Syntax:
a+b
The string is an immutable sequence data type. Concatenating immutable sequence data types always results in a new object.
Example 1: Strings are concatenated as they are, and no space is added between the strings.
s1="Welcome"
s2="to"
s3="python"
s4=s1+s2+s3
print (s4)#Output:Welcometopython
#python-programming #data-science #python #python3 #devops