String concatenation is simply adding strings together.
Here are sample String Concatenation:
Sample1:
>> a = ‘Free’
>>> b = ‘Linux’
>>> c = ‘Tutorials’
>>> a + b + c
‘FreeLinuxTutorials’
>>> d = a + b + c
>>> print (d)
FreeLinuxTutorials
>>>
Sample2:
>>> a = ‘Welcome’
>>> b = ‘to my’
>>> c = ‘Site’
>>> s = ‘ ‘
>>> a + s + b + s + c
‘Welcome to my Site’
>>> d = a + s + b + s + c
>>> print (d)
Welcome to my Site
Sample3:
>> ‘Welcome’ + ‘ Guys’
‘Welcome Guys’
Sample4:
>> str = ‘Welcome’
>>> str = str + ‘ to my Site’
>>> print (str)
Welcome to my Site
Sample5:
>> print (str)
Welcome to my Site
>>> str = str[0:7] + ‘ to my World’
>>> print (str)
Welcome to my World
Sample6:
>> str = ‘Knock! ‘
>>> print (str)
Knock!
>>> str * 6
‘Knock! Knock! Knock! Knock! Knock! Knock! ‘
Sample7:
>> x = 10
>>> y = 10
>>> x + y
20
>>> x = ’10’
>>> y = ’10’
>>> x + y
‘1010’