如何在python中使用“ \ newline”

时间:2019-08-12 13:30:41

标签: python escaping read-eval-print-loop

我想知道\newline的用法以及使用方法。
docs中,它表示:-

  

\newline:-反斜杠和换行符被忽略

我尝试在REPL中按以下方式使用它:

>>> a="first\newline"
>>> print(a)
first
ewline

我反而解释为\n LineFeed )。

0 个答案:

没有答案