输出九九乘法表
方法一:for循环
for i in range(1,10): for j in range(1,i+1): print("%s * %s = %s" %(j,i,j*i),end =" ") print()
方法二:while循环
a = 1 while a <= 9: b = 1 while b <= a: print("%s * %s = %s"%(b,a,b*a),end = " ") b +=1 print() a +=1
输出九九乘法表
方法一:for循环
for i in range(1,10): for j in range(1,i+1): print("%s * %s = %s" %(j,i,j*i),end =" ") print()
方法二:while循环
a = 1 while a <= 9: b = 1 while b <= a: print("%s * %s = %s"%(b,a,b*a),end = " ") b +=1 print() a +=1