python把数组中的数字每行打印3个并保存在文档中

    xiaoxiao2021-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)