How Can I Define Multiline String In Python

Discussion in 'Programming' started by Gabriel9999, Apr 1, 2019.

  1. Gabriel9999

    Gabriel9999 New Member

    Joined:
    Mar 12, 2019
    Messages:
    23
    Likes Received:
    1
    Trophy Points:
    3
    How can I define multiline string Python and print to the screen? Thanks in advance for your help!
     
  2. samueltarcin9999

    samueltarcin9999 New Member

    Joined:
    Mar 12, 2019
    Messages:
    15
    Likes Received:
    11
    Trophy Points:
    3
    Well. You can use triple quotes in order to define multi line string like sss='''This is a string'''
    For more information look = poftut.com/python-string-variable-type/
     
    Gabriel9999 likes this.
  3. hussain mujtaba

    hussain mujtaba New Member

    Joined:
    Apr 15, 2020
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    3
    Gender:
    Male
    You can use triple quotes to write multiline string or comments.Here is an example
    Code:
    string1=''' hello my name is
                           python3 '''
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice