Python Multi Line Strings
Multiline Strings
You can assign a multiline string to a variable by using three quotes:
Example
You can use three double quotes:
a = """Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do
eiusmod tempor incididunt
ut labore et dolore magna aliqua."""
print(a)
Try it Yourself »
Or three single quotes:
Example
a = '''Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do
eiusmod tempor incididunt
ut labore et dolore magna aliqua.'''
print(a)
Try it Yourself »
Note: in the result, the line breaks are inserted at the same position as in the code.