EN
Python - multiline strings
0
points
In this article, we would like to show you how to create multiline strings in Python.
1. Using single quotation marks
In this example, we use three single quotation marks to create a multiline string.
Practical example:
my_string = '''line1
line2
line3'''
print(my_string)
Output:
line1
line2
line3
2. Using double quotation marks
In this example, we use three double quotation marks to create a multiline string.
Practical example:
my_string = """"line1
line2
line3"""
print(my_string)
Output:
line1
line2
line3