Question: sumMatrix(numMat) Function that sums the elements of a Matrix represented as a nested list of integers. (Python Language) All input values are taken from the

sumMatrix(numMat) Function that sums the elements of a Matrix represented as a nested list of integers. (Python Language)

All input values are taken from the user.

Sample code: (this function finds the greater of 4 number, I need a fuction that sums the elements of a Matrix represented as a nested list of integers)

# Function Name: greatestOfFour

# Desc: Finds greatest of 4 numbers

# Parameters: num1-int, num2-int, num3-int, num4-int

# Return: int

defgreatestOfFour(num1, num2, num3, num4):

if num1>num2>num3>num4:

return num1

elif num2>num3>num4:

return num2

elif num3>num4:

return num3

else:

return num4

# Test Code

# Initialize Variables

num1=num2=num3=num4 = 0

# Read Input

print("Enter four numbers to check the greatest: ")

num1 =input("1st num: ")

num2 =input("2nd num: ")

num3 =input("3rd num: ")

num4 =input("4th num: ")

# Call function for Process and Output

print("Greatest of 4 numbers: ", greatestOfFour(int(num1),int(num2),int(num3),int(num4)))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!