2012-04-10 110 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') 

垂直空間的垂直標籤。

相關問題