Richard P.

asked • 05/07/24

(Sum elements column by column) Python Question

Write a function that returns the sum of all the elements in a specified column in a matrix using the following header:

def sumColumn(m, columnIndex):

Write a test program that reads a 3 × 4 matrix and displays the sum of each column. Note that the matrix is entered by rows and the numbers in each row are separated by a space in one line.

1 Expert Answer

By:

Iordan G. answered • 05/07/24

Tutor
5 (94)

Machine learning researcher and data scientist using Python

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.