creating multiline strings in Python

in python •  4 years ago  (edited)

Triple Quotes for a Multiline Python String

You can use a triple quote or triple double-quote to create a multiline string in Python:

multiline = '''
a string
  with many lines
    in python.
'''

multiline = """
You can use double-quotes
  for a multiline string too,
  and "quotes" within the 'string'.
"""

Read more here: https://blog.modernlearner.org/multiline-strings-in-python/

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!