How to input multiline strings in Python?

In Python, you can use triple quotes (”’) or (“””) to input multi-line strings. For example:

string = '''
This is a multi-line string.
It can contain multiple lines of text.
'''

Alternatively, you can use escape characters (\) to create line breaks.

string = 'This is a multi-line string.\
It can contain multiple lines of text.'
bannerAds