Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How can we print multiple blank lines in python?
We can print multiple blank lines in python by using the \n character the number of times we need a blank line. For example, If you need 5 blank lines, you can use −
Python 2.x:
print "\n\n\n\n\n"
Python 3.x:
print("\n\n\n\n\n")
You can use features like repetition operator in python to make this easier. For example,
Python 2.x:
print "\n" * 5
Python 3.x:
print("\n" * 5)
All of these commands will print 5 blank lines on the STDOUT.
Advertisements
