游戏中的反斜杠消失了,我怎样才能让它们可见?
__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.")
答案 0 :(得分:2)
'\'
字符被视为转义字符。使用r
前缀将其视为原始字符串文字
print(
r"""
_____ ___ ___ ___ _____
/ ___| / | / |/ | | ___|
| | / /| | / /| /| | | |__
| | _ / ___ | / / |__/ | | | __|
| |_| | / / | | / / | | | |___
\_____/ /_/ |_| /_/ |_| |_____|
_____ _ _ _____ _____
/ _ \ | | / / | ___| | _ \
| | | | | | / / | |__ | |_| |
| | | | | | / / | __| | _ /
| |_| | | |/ / | |___ | | \ \
\_____/ |___/ |_____| |_| \_\
"""
)