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]
mul(maxtrixone,maxtrixtwo)
def mul(maxtrixone,maxtrixtwo):
i = 0
ii = 0
ki = 0
while(ii < len(maxtrixone)):
j = 0
ij = 0
kj = 0
print("|", end = "")
while(ij < len(maxtrixtwo[i])):
tempone = maxtrixone[i+ki][j]*maxtrixtwo[i][j+kj]
temptwo = maxtrixone[i+ki][j+1]*maxtrixtwo[i+1][j+kj]
tempthree = maxtrixone[i+ki][j+2]*maxtrixtwo[i+2][j+kj]
print(" ",tempone+temptwo+tempthree,end = " ")
kj += 1
ij += 1
print(" |")
ki += 1
ii += 1
setup()
ไม่มีความคิดเห็น:
แสดงความคิดเห็น