Create a Long Multiline String in Python Using Parentheses & Single/Double Quotes

(Last Updated On: 16/03/2023)

Python Program to Create a Long Multiline String Using Parentheses & Single/Double Quotes

# Create a Long Multiline String Using parentheses and a single/double quotes in python

my_string = ("The only way to \n"
        	"learn to program is \n"
        	"by writing code.")

print(my_string)

Output:

The only way to 
learn to program is 
by writing code.

Leave a Reply

Your email address will not be published. Required fields are marked *