Python Lab Ex 7

seeders: 0
leechers: 0
Added on April 19, 2015 by 3sgknightin Other > Tutorials
Torrent verified.



Python Lab Ex 7 (Size: 2.68 KB)
 L7_E1.py2.68 KB

Description

L7.2 Exercises
Exercise L7.E1 - Develop a program to read in two matrices A and B with dimensions 3 x 4 and 4 x 3
respectively, and compute and display their product AB (of dimensions 3 x 3). Assume that
the elements of the matrices are integers. You must use functions while implementing this
program. An example is shown below.

$ python matrix.py
Matrix A;
1 2 3 4
3 3 4 4
4 4 5 5
Matrix B;
1 3 5
7 7 7
3 4 5
3 4 5
Matrix AB;
42 53 64
48 62 76
62 80 98
$


Hint: Define global variables of two-dimensional arrays to store the values of the matrices A and B.
Break down the program into three functions as follows:
1. Read in the elements of matrices A and B
2. Compute the product of the two matrices
3. Display the resultant matrix AB


Related Torrents

torrent name size seed leech

Sharing Widget


Download torrent
2.68 KB
seeders:0
leechers:0
Python Lab Ex 7