3

I'm making a game in Python (text only) but it gets confusing when people play it because there is no space between the paragraphs, so it looks like this:

'You step outside and feel the wind on your face.'
'Which direction do you turn?'

But I would like it to look like this:

'You step outside and feel the breeze on your face'

'What do you do next'?

Here's my code:

print 'You step outside and feel the cool breeze on your face.'
what = raw_input ('What do you do next ')

Thanks!

4 Answers 4

9

Print a newline character.

print("\n")

Or:

print("An angry-looking dwarf throws an axe at you.\nYou die.\n")
1
  • print("An angry-looking dwarf throws an axe at you.\n\nYou die.\n") . 2 times '\n' will come Jan 10 at 7:49
3

You have a few solutions:

The simpler one would be to use a print statement between your lines, which, used alone, prints a line feed.

Alternatively, you could you end the string you're printing with a '\n' character, which will cause a line feed, or you could start your input with the same character.

1
print('\v')

vertical tab for vertical space.

0

I can give you three Solutions.

First Solution

  print(f"""You step outside and feel the breeze on your face


  What do you do next?""")

Second Solution

print("You step outside and feel the breeze on your face. \n\nWhat do you do next?")

Third Solution

print("You step outside and feel the breeze on your face")
print("\n")
print("What do you do next?")

Check Out the Image Given Below for Code and Output 🙂.

Check Out the Image for code and output

Not the answer you're looking for? Browse other questions tagged or ask your own question.