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