#Atuhor:xiesongyou
for i in range(1,10):
for j in range(1,i+1):
print("%d * %d = %-8d"%(j,i,i*j),end="")
print()
print("- - " * 35)
for i in range(9,0,-1):
for j in range(1,i+1):
print("%d * %d = %-8d"%(j,i,i*j),end="")
print()
print("- - " * 35)
for i in range(1, 10):
print(" "*((9-i) * 12), end="")
for j in range(1, i + 1):
print("%d * %d = %-4d" % (j, i, i * j), end="")
print()
print("- - " * 35)
for i in range(9, 0, -1):
print(" " * ((9 - i) * 12), end="")
for j in range(1, i + 1):
print("%d * %d = %-4d" % (j, i, i * j), end="")
print()
print("- - " * 35)
转载于:https://www.cnblogs.com/xiesongyou/p/8320277.html