Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing multiple blank lines in python

Is there a way that you can print more than one blank line in a programme, without having to type

print("\n")

load of times?

For example, I want to have a blank page (about 40 lines, I think) before my next line of text

like image 577
brisbass Avatar asked Jan 24 '15 21:01

brisbass


People also ask

How do you insert blank lines in Python?

The new line character in Python is \n .

How do you print a blank space in Python?

Call print(value) with value as " " to print a space on a single line.

How do you print multiple lines on one line in Python?

To print multiple expressions to the same line, you can end the print statement in Python 2 with a comma ( , ). You can set the end argument to a whitespace character string to print to the same line in Python 3.

What does empty print () do in Python?

It prints an empty line, just as you have said. It will leave a blank line in the output.


1 Answers

Just use multiplication, this will repeat your string however many times you'd like, in this case new lines

>>> print('\n' * 40)
like image 120
Cory Kramer Avatar answered Sep 22 '22 08:09

Cory Kramer