Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def manip_matrice(A, B, i, j):
- m_A = len(A[0])
- m_B = len(B[0])
- count = True
- for c in range(len(A)):
- n_A = len(A[c])
- if m_A != n_A :
- count = False
- for d in range(len(B)):
- n_B = len(B[d])
- if m_B != n_B :
- count = False
- if count == True:
- if len(A[0]) != len(B):
- return "Ces matrices ne se multiplient pas"
- else:
- matrice = np.zeros(( len(A), len(B[0]) ))
- for a in range(len(A)):
- for b in range(len(B[0])):
- for k in range(len(A[0])):
- matrice[a][b] += A[a][k] * B[k][b];
- print(matrice)
- return matrice[i][j];
- else:
- return "Ces matrices ne se multiplient pas"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement