首页
IT
登录
6mi
u
盘
搜
搜 索
IT
python把数组中的数字每行打印3个并保存在文档中
python把数组中的数字每行打印3个并保存在文档中
xiaoxiao
2021-04-11
40
arrs=[2,15,48,4,5,6,7,6,4,1,2,3,6,6,7,4,6,8] f=open('test.txt','w+') count=0 for temp in arrs: count+=1 print >> f,temp, if(count%3==0): print >> f f.close()
结果:
转载请注明原文地址: https://ju.6miu.com/read-666431.html
技术
最新回复
(
0
)