直接上代码:
l
=["A","B","C","D"]
f
=open("k1.txt","w")
f
.writelines
(l
)
f
.close
()
l
=["A","B","C","D",1,2,3]
f
=open("k2.txt","w")
f
.write
(str(l
))
f
.close
()
l
=["A","B","C","D"]
str = '\n'
f
=open("k3.txt","w")
f
.write
(str.join
(l
))
f
.close
()
'''
输出样式:
A
B
C
D
'''
转载请注明原文地址: https://lol.8miu.com/read-7231.html