How to break text into paragraphs (python)

MrZooSuit

So I'm making a text-based game but when I run my code the text isn't broken up into paragraphs, there is no space between the first print() command and the one right after it.

I've tried breaking up the text by putting huge spaces between the text in one print command but that is inefficient and makes my code look messy and difficult to work in.

if status.lower().strip() == "modest":
    print("#.")
    print("#")
    print("#")
    print("#")
    print("#")
else:
    main()

So what I am trying to do is replicate an HTML command <br> which can add space between two lines of text. Is there any way I can do that?

Lamanus

Use linebreak command \n several times as you wish and I suggest you use triple quotes as follows:

print("""
    First paragraph \n\n
    Second paragraph \n\n
    ...
    Last paragraph.
""")

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Python How to split text file into paragraphs?

How to break long strings into paragraphs

how to add paragraphs or break in excel vba

how can i count paragraphs of text file using python?

How to detect paragraphs in a text document image for a non-consistent text structure in Python

How to add paragraphs to list in Python

Parsing text into paragraphs with python (loop issue)

How to add text to paragraphs on clicking button

how to extract the first paragraphs from text in dataframe?

how to get the text of these paragraphs using selenium and xpath

How to add text to paragraphs similar to table cells

How to detect what kind of break line in a text file in python?

How to bold and to break text in two line of plt.annotate [python]

How to split an image into clean paragraphs in Python/OpenCV?

How to make paragraphs readable within python code

How to sentence Tokenize a list of Paragraphs in Python?

How to break this Python line?

How to break the loop in python

Better way to split text into smaller paragraphs given a length Python

Python / Selenium - can't print text contents of all paragraphs

Extracting text from specific paragraphs of the website with Python 2

python reading text file and find paragraphs that contain two specific words

Split text rows in dataframe into paragraphs and keep document id - python

How to count divs and append the total to text inside corresponding paragraphs?

For MacOS, how to delete text (long paragraphs) in multiple files?

How to make paragraphs of text or lists line up side-by-side

How to scrape text from paragraphs with different id name?

How to avoid overlapping text in two paragraphs side by side

How to apply style to all paragraphs with upper case text?