# coding:utf-8 # print输出时有用什么符号间隔,间隔距离多大,如何换行 a = 0 for i in range(1, 21): a += 1 print("%4d" % i, end=" ") # if i % 5 == 0: # print(" ")
运行后的结果: