Question: Implement a functionrev_diag_elems_greater_than(table, x)that returnsTrueif all elements on the reverse diagonal of a given input tabletableis greater than a numberxand, otherwise, returnsFalse. Input: non-empty tabletablewith

Implement a functionrev_diag_elems_greater_than(table, x)that returnsTrueif all elements on the reverse diagonal of a given input tabletableis greater than a numberxand, otherwise, returnsFalse.

Input:non-empty tabletablewith numeric elements and an equalnumber of rows and columns, numberx

Output:Trueif all elements on the reverse diagonal oftableare greater thanx; otherwiseFalse

Note: the reverse diagonal of a table is the diagonal from the lower-left entry to the upper right-entry

For example:

>>> table = [[0, 0,1],

...[0,1, 0],

...[1, 0, 0]]

>>>rev_diag_elems_greater_than(table, 0.5)

True

>>> table = [[0.1, 0.0,1.0],

...[0.5,-1.0, 2.0],

...[0.5, -4.0, 5.3]]

>>>rev_diag_elems_greater_than(table, 0)

False

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 Programming Questions!