We can use following ways to concatenate multiple string together in Python:
I. use + operator:
E.g.
>>> fname=”John”
>>> lname=”Ray”
>>> print fname+lname
JohnRay
II. use join function:
E.g.
>>> ”.join([‘John’,’Ray’])
‘JohnRay’
We can use following ways to concatenate multiple string together in Python:
I. use + operator:
E.g.
>>> fname=”John”
>>> lname=”Ray”
>>> print fname+lname
JohnRay
II. use join function:
E.g.
>>> ”.join([‘John’,’Ray’])
‘JohnRay’
by
Tags:
Leave a Reply