Issue
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?
Solution
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.
""")
Answered By - Lamanus
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.