【问题标题】:How can I print a new line in Colab?如何在 Colab 中打印新行?
【发布时间】:2020-06-20 21:30:27
【问题描述】:

我正在使用 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

【问题讨论】:

  • 只是print(test)
  • 哦,成功了,谢谢

标签: python printing google-colaboratory


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-25
    • 2021-12-12
    • 2021-09-12
    相关资源
    最近更新 更多