How to write multiple strings in one line?

后端 未结 11 652
谎友^
谎友^ 2020-12-01 03:28

I\'ve started to learn Python with LPTHW and I\'ve gotten to exercise 16:

http://learnpythonthehardway.org/book/ex16.html

And feel like an idiot because I ca

11条回答
  •  情话喂你
    2020-12-01 03:53

    This worked for me.

    target.write("line1\nline2\nline3\n")

    Also, the keyword which made it clicked for me was mentioned by Ewart, "'\n' only make sense inside a string literal."

提交回复
热议问题