Python Program to Multiply Two Matrices

preview_player
Показать описание
In this example, we will learn to multiply two matrices using nested loops.
We will derive the matrix multiplication formula and then we will switch to the editor to code this matrix multiplication logic up!
Multiplication of two matrices a and b is defined only if the number of columns in a is equal to the number of rows b

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

If you share this playlist, make sure to tag me in your Instagram story.
Instagram: instagram.com/codewithharry

CodeWithHarry
Автор

Thank u Harry bhai!!!


Abhi mai aapki Java ki series follow kr rha hu aur sath-sath python ki bhi practice ho rhi hai!

Someone - Who is the best teacher in the world?
Me - Harry bhai!

Aap free me itne saare chize de rhe ho!!! Koi soch bhi nahi kr sakta ki free me itna kuchh mil skta hai!

Aap mere inspiration ho! Thank u harry bhai!

Ab meri hobby coding hai! Bahut maza ata hai aapke saath code krne me aisa lgta hai ki aap mere samne hi baithe ho aur mujhe sikha rhe ho!!!

Thank u Harry bhai!

yashpatil
Автор

If Harry hearts ❤️ my comment, my dream to become a successful programmer will be fulfilled😊

ilokebib
Автор

Love you bro... Your python tutorials really helped me and it encouraged me to learn more codings.

abdaihannan
Автор

Sir please make video series on unity game engine for game development and for game reply

sonisinha
Автор

I I am begginer

And you motivated for programming

mohitsharma
Автор

Very Precise and too the point video thanks and keep making more and more video's

NarendraSharmaa
Автор

Bhaiya recently I saw your video on matrix multiplication using python program and I really liked it and in the video itself you asked us that if anyone can generate the list containing the required no of zeroes with certain rows and certain column for storing the multiplied value in it .So I tried to write the code and i was successful in creating the desired list but I don't know why I am getting the wrong answer of the matrix multiplication.Bhaiya can you please help me in identifying where is the error in the code.I have Been trying this for 5 days but till now I am not able to find it

The code is the following:-
p=eval(input("enter the value of your 1st matrix"))#in the form of list
q=eval(input("enter the value of your 2nd matrix"))
r=len(p)
s=len(q)
t=len(p[0])
u=len(q[0])
x=[]
count=1
while count<=u:
x.append(0)
count+=1
y=[]
count1=1
while count1<=r:
y=y+[x]
count1+=1
print(y)
for i in range(0, len(y)):
for j in range(0, len(y[0])):
for k in range(0, s):
y[i][j]+=p[i][k]*q[k][j]
for rows in y:
print(rows)

prashunraj
Автор

thank you harry bhai this solution helped me a lot !.

rohitchitte
Автор

Great video harry sir...sir muje kuch problems hai please help it in coding

sandippankhaniya
Автор

To generate C
C = [[0 for i in range(len(A[0])] for j in range(len(B))]

sandeepkumarkasera
Автор

Thanks bhai problem thi ismae and i will practice python playlist.

aashishmalhotra
Автор

thanks a lot for explaining in such details.

marthusthang
Автор

Its your 5th video today... I don't believe this!! 🔥🔥🔥

shivanshgoyal
Автор

Thanks, Harry Bhai. Maja agaya! Praji aise hi logical wale questions. chahiye tha! apka infix to prefix ka bhi gajab tha!

satyajitdas
Автор

Hello, can we do like this

x1 = array(range(0, 9)).reshape(3, 3)
print(x1)
x2 = array(range(1, 10)).reshape(3, 3)
print(x2)

y=x1.dot(x2)
print(y)

brightside
Автор

Nice video harry bhai please make how to count a duplicate program in a list

armanahmed
Автор

Sir please make a program of taking matrix input from user and then how to multiply them.

tehseenjahan
Автор

Luv you sir my suggestion for next series after dsa and java is flutter, dart

ChSajjan
Автор

sir aapki videos amazing hoti hai but main chahata hoon ki aap ek app ko code karein by using python (Pure python)

ujjwalandtanmay