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
The new line character in Python is \n .
Call print(value) with value as " " to print a space on a single line.
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.
It prints an empty line, just as you have said. It will leave a blank line in the output.
Just use multiplication, this will repeat your string however many times you'd like, in this case new lines
>>> print('\n' * 40)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With