Question: Write a Python function compute totals(w) that takes a Worksheet object w containing student names and marks for various modules as above and that returns
Write a Python function compute totals(w) that takes a Worksheet object w containing student names and marks for various modules as above and that returns a fresh worksheet object containing a modified copy of the original with one extra column added to the right (Column F below) that contains the total of the module marks for that student. The result when printed (using w.print()) should appear as follows. Note that your compute totals(w) code may interact with a Worksheet object using only the methods and values described above. Function compute totals(w) is not part of the implementation of class Worksheet, but an external much that uses the capabilities of objects of that class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
