Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

print multiple lines python

#You can use 
 to create a carriage return.
print("first line
Second line")

#Or use the following syntax to replace the commas with 

#to create carriage returns for each line.

print("first line", "second line", sep="
")

#Or use triple quotation marks at the start and end of 
#the text and format the text how you want it to appear.

print("""
Line1
Line2
""")
 
PREVIOUS NEXT
Tagged: #print #multiple #lines #python
ADD COMMENT
Topic
Name
7+4 =