返回列表 發帖

巢狀迴圈 (一) - 九九乘法表

顯示如下之九九乘法表

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%-2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range (1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%-2d"%(i,j,i*j),end=" ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for c in range(1,13):
  2.     for y in range(1,13):
  3.         print("%-2d*%-2d=%-3d"%(c,y,c*y),end=" ")
  4.     print("_______")
複製代碼
._.

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%d"%(i,j,i*j),end=" ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         product=i*j
  4.         print("%d*%d=%-2d"%(i,j,i*j),end="  ")
  5.     print()
  6.    
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%2d"%(i,j,i*j),end="  ")
  4.     print()
複製代碼

TOP

  1. for i in range(1,10):
  2.     for j in range(1,10):
  3.         print("%d*%d=%-2d"%(i,j,i*j),end=" ")
  4.     print()
複製代碼

TOP

返回列表