#乘法口诀 for i in range(1,10): for j in range(1,i+1): print ( j,'*',i,'=',j*i,'',' ',end='') print(end=' ')
注意使用的Python环境为 3.*
2
for i in range(1, 10): print " ".join(["%d*%d=%d" % (j, i, i*j) for j in range(1, i+1)])