python 在单独的行上打印并忽略反斜杠

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 在单独的行上打印并忽略反斜杠相关的知识,希望对你有一定的参考价值。

print('line1\nline2\nline3')

# In contrast, to ignore the backslash and print raw text 
print(r'C:\\location\n')

以上是关于python 在单独的行上打印并忽略反斜杠的主要内容,如果未能解决你的问题,请参考以下文章