【问题标题】:How do I make spaces between paragraphs in my Python script?如何在 Python 脚本中的段落之间留出空格?
【发布时间】:2026-02-01 02:25:01
【问题描述】:

我正在用 Python 制作一个游戏(仅文本),但是当人们玩它时会感到困惑,因为段落之间没有空格,所以它看起来像这样:

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

但我希望它看起来像这样:

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

'What do you do next'?

这是我的代码:

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

谢谢!

【问题讨论】:

    标签: python paragraph


    【解决方案1】:

    打印一个换行符。

    print("\n")
    

    或者:

    print("An angry-looking dwarf throws an axe at you.\nYou die.\n")
    

    【讨论】:

      【解决方案2】:

      您有几个解决方案:

      更简单的方法是在行之间使用print 语句,单独使用它会打印换行符。

      或者,您可以使用'\n' 字符结束要打印的字符串,这将导致换行,或者您可以使用相同的字符开始输入。

      【讨论】:

        【解决方案3】:
        print('\v')
        

        垂直空间的垂直标签。

        【讨论】: