sum =[] j=0 for i in range(100): sum.append(i) for i in range(100): print (str(sum[i])+' ',end='') j = j+1 if j%10 == 0:# %10表示10个数字一行 print()
或者不用数组,如下:
j=0 for i in range(100): print (str(i)+' ',end='') j = j+1 if j%10 == 0:# %10:10个数字一行 print()