[英]How do I make spaces between paragraphs in my Python script?
我正在 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")
你有幾個解決方案:
更簡單的方法是在行之間使用print
語句,單獨使用它會打印換行符。
或者,您可以使用'\n'
字符結束要打印的字符串,這將導致換行,或者您可以使用相同的字符開始輸入。
print('\v')
垂直空間的垂直選項卡。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.