【发布时间】:2018-01-28 04:19:38
【问题描述】:
在 Python 中,是否可以打印带有换行符和缩进的字符串,但只能使用 1 行代码? (见下文)
Wow!
This is on a new line!
【问题讨论】:
-
我强烈建议阅读 Python 字符串:
print("Wow!\n\tThis is on a new line!") -
print('\tWow!\n\tThis is on a new line!')? -
确保您以@NiemaMoshiri 的身份行事,专门查找术语“转义字符”。
标签: python indentation line-breaks