 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Multi-Line printing in Python
We have usually seen the print command in python printing one line of output. But if we have multiple lines to print, then in this approach multiple print commands need to be written. This can be avoided by using another technique involving the three single quotes as seen below.
Example
print(''' Motivational Quote :\n Sometimes later becomes never, Do it now. Great things never come from comfort zones. The harder you work for something, the greater you'll feel when you achieve it. ''')  Running the above code gives us the following result:
Motivational Quote : Sometimes later becomes never, Do it now. Great things never come from comfort zones. The harder you work for something, the greater you'll feel when you achieve it.
We can use multiline printing to produce nicely formatted text also as seen below.
Example
print(''' =========================================== ||                                       || || WORK                                  || || HARD                                  || ||                                       || ||                                       || ||                                       || =========================================== ''')  Running the above code gives us the following result:
============================= || || || WORK || || HARD || || || || || || || =============================
Advertisements
 