作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
游戏结束时的反斜杠消失了,如何保持它们可见?
__author__ = 'daniel'
# Game Over 2.0
# demonstrates the use of quotes in strings
print ("Program 'Game Over' 2.0")
print ("Same","message","as before")
print ("Just",
"a bit",
"bigger")
print ("Here", end=" ")
print ("it is.....")
print(
"""
_____ ___ ___ ___ _____
/ ___| / | / |/ | | ___|
| | / /| | / /| /| | | |__
| | _ / ___ | / / |__/ | | | __|
| |_| | / / | | / / | | | |___
\_____/ /_/ |_| /_/ |_| |_____|
_____ _ _ _____ _____
/ _ \ | | / / | ___| | _ \
| | | | | | / / | |__ | |_| |
| | | | | | / / | __| | _ /
| |_| | | |/ / | |___ | | \ \
\_____/ |___/ |_____| |_| \_\
"""
)
input("\n\nPress the enter key to exit.")
最佳答案
'\'
字符被视为转义字符。使用 r
前缀将其视为原始字符串文字
print(
r"""
_____ ___ ___ ___ _____
/ ___| / | / |/ | | ___|
| | / /| | / /| /| | | |__
| | _ / ___ | / / |__/ | | | __|
| |_| | / / | | / / | | | |___
\_____/ /_/ |_| /_/ |_| |_____|
_____ _ _ _____ _____
/ _ \ | | / / | ___| | _ \
| | | | | | / / | |__ | |_| |
| | | | | | / / | __| | _ /
| |_| | | |/ / | |___ | | \ \
\_____/ |___/ |_____| |_| \_\
"""
)
关于python - 打印函数反斜杠消失Python 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32238153/
我是一名优秀的程序员,十分优秀!