当前位置:主页 > 软件编程 > Python代码 >
时间:2021-07-22 07:46:55 | 栏目:Python代码 | 点击:次
如下所示:
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()
结果: