How to write multiple strings in one line?

后端 未结 11 641
谎友^
谎友^ 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:54

    Not sure if this is pythonic way, but it gets the job done anyway.

    a = f"""
    {line1}
    {line2}
    {line3}
    """
    target.write(a)
    

提交回复
热议问题