#打印九九乘法表 for i in range(1,10): s = "" for j in range(1,i+1): s += str(j) + ‘*‘ + str(i) + ‘=‘ + str(i*j)+ ‘ ‘ print(s)
方法2:
#打印九九乘法表 for i in range(1,10): for j in range(1,i+1): print(‘{}*{}={}\t‘.format(j,i,i*j),end="") print()
原文地址:https://www.cnblogs.com/KunGe-13/p/10203247.html
时间: 2024-10-11 23:29:32