We have already seen the basic use of print function previous article. Now, let’s see how to use print function for multi-line printing. This can easily be done using multiline string i.e. three single quotes ''' Geeksforgeeks ''' .
Let’s see different examples to see the demonstration for the same.
Example #1:
# basic example for multi-line printing print( ''' ======================================= | | | | | GeeksforGeeks | | | | | ======================================= ''' ) |
======================================= | | | | | GeeksforGeeks | | | | | =======================================
Example #2:
# basic example2 for multi-line printing print( '''list.head second third | | | | | | +----+------+ +----+------+ +----+------+ | 1 | None | | 2 | None | | 3 | None | +----+------+ +----+------+ +----+------+ ''' ) |
list.head second third
| | |
| | |
+----+------+ +----+------+ +----+------+
| 1 | None | | 2 | None | | 3 | None |
+----+------+ +----+------+ +----+------+
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
Recommended Posts:
- Multiline comments in Python
- Python - Horizontal Concatenation of Multiline Strings
- How do we create multiline comments in Python?
- Object Oriented Programming in Python | Set 2 (Data Hiding and Object Printing)
- Programs for printing pyramid patterns in Python
- Python | Printing list vertically
- Python | Avoiding quotes while printing strings
- Python | Printing String with double quotes
- Star fractal printing using Turtle in Python
- Printing HELLO with turtle module
- Important differences between Python 2.x and Python 3.x with examples
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Sort Python Dictionaries by Key or Value
- Python | Merge Python key values to list
- Reading Python File-Like Objects from C | Python
- Python | Add Logging to a Python Script
- Python | Add Logging to Python Libraries
- JavaScript vs Python : Can Python Overtop JavaScript by 2020?
- Python | Visualizing O(n) using Python
- Python | Index of Non-Zero elements in Python list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

