How to add a new line systematically between every line

247 views Asked by At

I am trying to have a story where the reader picks each outcome. However, it is a lot of reading for the user and I want to make every single printed line have a whole line between it. I haven't been able to find anything where I can tell the program to create a new blank line between every print statement without having to put some sort of code between every single line, which is and will continue to expand more and more. I want some code at the beginning to automatically do it.

print('Some storyline moving the story along...')
ans2 = input('Reader reads a situation and makes a decision based on it')

I have already written much of the story code and branches of the story, is there any way of having it detect print statements and adding a line after each one? (python 3)

1

There are 1 answers

0
MichaelJanz On

Just append \n\n on your string, so you get a new empty line:

print('Some storyline moving the story along...\n\n')

If you dont want to change the string, create a new function:

def print_newline(text):
   `print(f'{text}\n\n')`