顯示如下之九九乘法表
- for i in range(1,10):
- for j in range(1,10):
- print("%d*%d=%-2d"%(i,j,i*j),end=" ")
- print()
複製代碼- for i in range(1,10):
- for j in range(1,10):
- print("{}*{}={}".format(i,j,i*j),end="\t")
- print()
複製代碼- for i in range(1,10):
- for j in range(1,10):
- print(f"{i}*{j}={i*j}",end="\t")
- print()
複製代碼 |