代码(四个):
for i in range(1,10):
for j in range(1,i+1):
l = j*i
print("{}*{}={:2d}".format(i, j, l), end="\t")
print("\n")
for i in range(1,10):
for j in range(i,10):
l = j*i
print("{}*{}={:2d}".format(i, j, l), end="\t")
print("\n")
for i in range(9,0,-1):
for k in range(9,i,-1):
print(end="\t\t")
for j in range(i,0,-1):
l = j*i
print("{}*{}={:2d}".format(i, j, l), end="\t")
print("\n")
for i in range(9,0,-1):
for k in range(0,i-1):
print(end="\t\t")
for j in range(9,i-1,-1):
l = j*i
print("{}*{}={:2d}".format(i, j, l), end="\t")
print("\n")