# python花式打印 9*9 乘法口诀表

for i in range(1,10):
for j in range(1,10):
if i <= 9:
print(f"{j}×{i} = {i * j}", end="\t")
print("")


for i in range(1,10):
for j in range(1,i+1):
print(f"{j}×{i}={i*j}",end="\t")
print(" ")


for i in range(1,10):
for j in range(i,10):
print(f"{i}×{j} = {i * j}", end="\t")
print(" ")


for i in range(1,10):
for k in range(1,10-i):
print(end="        ") #此处七个空格
for j in range(1,i+1):

print("%d×%d=%2d" % (i, j, i*j), end=" ") #切记此处不能用格式化输出.format方式或者f"{}"， 要用格式化输出只能pycharm中才会显示下面的样式。
print(" ")


for i in range(1,10):
for k in range(1,i):
print(end="        ")  #此处8个空格
for j in range(i,10):
print("%d×%d=%2d" % (i, j, i * j), end=" ")#切记此处不能用格式化输出.format方式或者f"{}"， 要用格式化输出只能pycharm中才会显示下面的样式。
print(" ")


for i in range(1,10):
for k in range(1,10-i):
print(end="        ")#此处为8个字节
for j in range(1,i+1):
print(f"{j}×{i} = {i * j}", end="        ")#此处为8个字节
print(" ")


for i in range(1,10):
for k in range(1,i):
print(end="        ") 　　　　　　　　#此处8个空格
for j in range(i,10):
print(f"{j}×{i} = {i * j}", end="        ") 　　　　　　　　#此处8个空格
print(" ")
print("\n")


©️2019 CSDN 皮肤主题: 黑客帝国 设计师: 上身试试