How will you concatenate multiple strings together in Python?

We can use following ways to concatenate multiple string together in Python:

  • use + operator:
    E.g.
    >>> fname=”John”
    >>> lname=”Ray”
    >>> print fname+lname
    JohnRay
  • use join function:
    E.g.
    >>> ”.join([‘John’,’Ray’])
    ‘JohnRay’

Leave a Reply

Your email address will not be published. Required fields are marked *