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
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