1.左下角输出
1 for i in range(1,10): 2 for j in range(1,i+1): 3 print("%s*%s=%s"%(i,j,i*j),end=" ") 4 print()
2.左上角输出
for i in range(1,10): for j in range(i,10): print("%s*%s=%s"%(i,j,i*j),end=" ") print()
3.右上角
1 for i in range(1,10): 2 for k in range(1,i): 3 print(end=" ") 4 for j in range(i,10): 5 print("%d*%d=%d"%(i,j,i*j),end=" ") 6 print("")
4.右下角
1 for i in range(1,10): 2 for k in range(1,10-i): 3 print(end=" "*7) 4 for j in range(1,i+1): 5 print("%d*%d=%d"%(i,j,i*j),end=" ") 6 print()