
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
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.
- Related Articles
- How to print multiple blank lines in C#?
- How can we combine multiple print statements per line in Python?
- How can multiple lines be visualized using Bokeh Python?
- How we can bundle multiple python modules?
- How do we use file.readlines() to read multiple lines using Python?
- How we can extend multiple Python classes in inheritance?
- How we can split Python class into multiple files?
- Can we initialize blank final variable in Java
- How we can break a string with multiple delimiters in Python?
- How can we do Python operator overloading with multiple operands?
- How to match pattern over multiple lines in Python?
- How can we do the basic print formatting for Python numbers?
- How to print a blank line in C#?
- How to write multiple lines in text file using Python?
- How to Print Lines Containing Given String in File using Python?

Advertisements