วันจันทร์ที่ 19 ตุลาคม พ.ศ. 2558

Subtract two matrices.

def setup():
   rowone = [1, 2, 3]
   rowtwo = [2, 3, 4]
   rowthree = [3, 4, 5]
   maxtrixone = [rowone, rowtwo, rowthree]
   rowfour = [4, 5, 6]
   rowfive = [5, 6, 7]
   rowsix = [6, 7, 8]
   maxtrixtwo = [rowfour, rowfive, rowsix]
   subtwo(maxtrixone,maxtrixtwo)
 
def subtwo(maxtrixone,maxtrixtwo):
   i = 0
   while(i < len(maxtrixone)):
      j = 0
      print("|", end = "")
      while(j < len(maxtrixone[i])):
         print("",maxtrixone[i][j]-maxtrixtwo[i][j],"",end = "")
         j = j + 1
      print("|")
      i = i + 1
     
setup()

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

Link Video Presentation Resort Managemant System Project.

Video Presentation Resort Managemant System Project. จัดทำโดย พากษ์เสียง: คุณาสิน  ทองมณี  5801012620011 ลำดับภาพ: สุพิชชา  ศรีศิริ...