2012-04-10 108 views
0

我在Python做一个游戏(纯文本),但它变得混乱,当人们玩它,因为在段落之间没有空格,所以它看起来是这样的:如何在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 ') 

谢谢!

回答

5

打印换行符。

print("\n") 

或者:

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

你有几个解决方案:

比较简单的一个办法是使用你的线,其中,单独使用,打印一个换行符之间的print声明。

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

1
print('\v') 

垂直空间的垂直标签。

相关问题