首页 > 解决方案 > 如何在 Colab 中打印新行?

问题描述

我正在使用 google colab 并想将一个句子分成两行。我试过 \n 和 \r,但它们不起作用。

test = "This is the first line. \r\n This is the second line"
test

这是代码的链接

https://colab.research.google.com/drive/11FhjbT2VvCepdFKSCTVQjYtQfnSxsrTH?usp=sharing

标签: pythonprintinggoogle-colaboratory

解决方案


TYZ给了我答案。print(test) 而不仅仅是测试。


推荐阅读