球球大佬教一下如何使列表输出每规定个数换行?阿里卡多!是列表哦!列表!
收起
是这样吗?
l=[1,2,3,4,5,6,7,8,9] n=4 #设置每行个数 for i in range(0,len(l),n): print(*l[i:i+n],end=' ') print()
报告相同问题?