Very basic Python question (strings, formats and escapes)

后端 未结 10 2100
别那么骄傲
别那么骄傲 2021-02-06 10:59

I am starting to learn Python with an online guide, and I just did an exercise that required me to write this script:

from sys import argv

script, filename = ar         


        
10条回答
  •  春和景丽
    2021-02-06 11:59

    I think they want you to use string concatenation:

    target.write(line1 + "\n" + line2 + "\n" + line3 + "\n")
    

    Much less readable, but you have only one target.write() command

提交回复
热议问题