函数实现99乘法表的打印
# 1.使用函数重构乘法口诀表并调用
def multiplication(n):
for i in range(1,n+1):
for j in range(1,i+1):
print(j,"*",i,"=",j*i,end="\t")
print()
#调用函数
a=int(input("请输入您想打印的乘法口诀表部分"))
multiplication(a)
运行结果:
标签:九九乘法,函数,python,口诀,multiplication,range,print,乘法 From: https://blog.51cto.com/u_15937426/7381189