Search for question
Question

Exercise A: "Matrix Validity Test"

For this exercise you will design and implement a function that takes one argument and returns a

single Boolean value indicating whether or not the argument is a "valid" matrix. The operational

definition for a "valid" matrix (for this activity) is a rectangular list of lists of numeric data elements,

so your function will need to test each of these three properties separately.

In order to complete this task, you will need to:

• recognize that the two data types in Python that are actually numeric are "int" and "float"

read about Python's built-in "isinstance" function

Your submission for this exercise:

• must be a source code file with filename¹ 'comp1405_f22_#########_tutorial_07_a.py'

must use one or more loops to check that every element in the argument is, itself, a list

must use one or more loops to check that every "row" of the matrix is the same length

must use one of more loops to check that every element in the matrix is a numeric value