Skip to main content
 首页 » 编程设计

python之如何在我的 Python 脚本中的段落之间留出空格

2025年05月04日13jackei

我正在用 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 ') 

谢谢!

请您参考如下方法:

打印换行符。

print("\n") 

或者:

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