How to print a linebreak in a python function?

前端 未结 8 765
旧时难觅i
旧时难觅i 2020-12-07 14:19

I have a list of strings in my code;

A = [\'a1\', \'a2\', \'a3\' ...]
B = [\'b1\', \'b2\', \'b3\' ...]

and I want to print them separated b

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 14:31

    You can print a native linebreak using the standard os library

    import os
    with open('test.txt','w') as f:
        f.write(os.linesep)
    

提交回复
热议问题