Reference no: EM132357236
Question
Write a function called printAverages that expects a two-dimensional table of integers (implemented as a list of lists) as its only parameter, where each row of the table contains the quiz scores for a student.
For each row of the table , your function should compute the average of all but the lowest score in the row and print that average. For example, given an table of quiz scores that looks like this:
0 1 2 3 4
0 50 50 0 50 50
1 85 75 70 65 5
2 0 5 5 0 5
The printAverages function should print this:
Average for row 0 is 50.0
Average for row 1 is 72.5
Average for row 2 is 3.75
You may assume that no quiz score is less than 0 or greater than 100. The values may be either integers or floating point numbers. You may also assume that every row contains the same number of scores. Note that only one lowest score in a row is dropped.
Your function should not ask for keyboard input, and the only value it returns is None. Note that the table of scores could have any number of rows or columns so long as the number is greater than zero; the dimensions of the table will not necessarily be the same as in the example given on the previous page.
The list of lists for the sample table would look like this: [[50, 50, 0, 50, 50], [80, 75, 70, 65, 5], [0, 5, 5, 0, 5]]
Please use Python 3 and focus on using nested loops and not shortcuts around nested loops.