155k views
3 votes
Let A be a 2D list in Python containing randomly assigned values where its size is also randomly generated up to 10 rows and 10 columns. Let B be another 2D list in Python containing randomly assigned values where its size is also randomly generated up to 10 rows and 10 columns. Write a Python3 program to check if we can multiply these two lists as matrices

1 Answer

4 votes

Answer:

Rows and cols of matrix1 : 5 6

Rows and cols of matrix1 : 4 4

We can't multiply these two as matrices.

Rows and cols of matrix1 : 3 8

Rows and cols of matrix1 : 8 6

We can multiply these two as matrices.

Step-by-step explanation:

Note: Check attachment for the code. Also note that "page (1/3), page (2/3) and page (3/3)" are not part of the code, it is only for numbering the pages.

So, the aim in this question is to check if we can multiply the two lists given above as matrices. So, check below for what we are are going to input as the Python3 program which is in the attached file.

Therefore, when we write the Python3 program and run it we are going to get an output which will read as the following;

Rows and cols of matrix1 : 5 6

Rows and cols of matrix1 : 4 4

We can't multiply these two as matrices.

Rows and cols of matrix1 : 3 8

Rows and cols of matrix1 : 8 6

Let A be a 2D list in Python containing randomly assigned values where its size is-example-1
Let A be a 2D list in Python containing randomly assigned values where its size is-example-2
Let A be a 2D list in Python containing randomly assigned values where its size is-example-3
User Hpaknia
by
7.0k points