Question
In python :Write a program so that main calls the following functions: getMatrix-creates and returns a 3X3 matrix printMatrix-prints the matrix row by row sumRow(getsumrow)
In python :Write a program so that main calls the following functions:
getMatrix-creates and returns a 3X3 matrix
printMatrix-prints the matrix row by row
sumRow(getsumrow) returns the sum of the elements of a single row of the matrix(pass in the matrix and the row indext
Comment each of the following things in the program:
-begin the program with a comment
-Begin each function with a comment.
Prompt the user for the element
example input:
enter the next element:1
enter the next element:2
enter the next element:3
enter the next element:4
enter the next element:5
enter the next element:6
enter the next element:7
enter the next element:8
enter the next element:9
1 2 3
4 5 6
7 8 9
The sum of row 1 is 6
The sum of row 2 is 15
The sum of row 3 is 24
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started