Very basic Python question (strings, formats and escapes)

后端 未结 10 2077
别那么骄傲
别那么骄傲 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:50

    This does it in two lines. It puts the line you want to print in a variable so it's more readable

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

提交回复
热议问题