以下使用 来添加新行:
>>> '"Isn't," she said.' '"Isn't," she said.' >>> print('"Isn't," she said.') "Isn't," she said. >>> s = 'First line. Second line.' # 意味着新行 >>> s # 不使用 print(), 包含在
以下使用 反斜线() 来续行:
hello = "This is a rather long string containing several lines of text just as you would do in C. Note that whitespace at the beginning of the line is significant." print(hello)