我正在用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'
字符结束正在打印的字符串,这将导致换行,也可以用相同的字符开始输入。相关问题 更多 >
编程相关推荐