How to Print Multiple Blank Lines in Python?

Estimated read time 1 min read

To print multiple blank lines in Python, you can use the print() function and pass an empty string as an argument, like this:

print("\n\n")

This will print two blank lines, separated by a newline character.

Alternatively, you can use the print() function with the '\n' character to print a newline character, like this:

print("\n")

You can then call this command multiple times to print multiple blank lines, like this:

print("\n")
print("\n")
print("\n")

This will print three blank lines.

You can also use a loop to print multiple blank lines, like this:

num_lines = 5

for i in range(num_lines):
    print()

This will print five blank lines.

You May Also Like

More From Author

+ There are no comments

Add yours

Leave a Reply