Question: Starter Code: Declare and initialize a 2 - D list with data in the given table gradebook = [ [ Student Name,Math,Science,History ] ,
Starter Code: Declare and initialize a D list with data in the given table
gradebook Student Name","Math","Science","History"
John Doe",
Jane Smith",
Alice Johnson",
Bob Brown",
Charlie Green",
Diana White",
Evan Black",
Fiona Blue",
George Red",
Holly Yellow", In the script, do the following:
a Print the table with proper alignment. Make sure to include the header for each column to show what
the column is about see sample output below
b Calculate the average score over the courses for each student and print it as an extra column to the
right of the table. Keep digits after the decimal point for floatingpoint values.
c Based on the average score of each student, calculate their letter grade and print it as an extra column
to the right of the table.
Use the following grading scale for conversion:
Average Score Letter Grade
and A
and B
and C
and D
Below F
d For each course, calculate the average score of the entire class, and print them as an extra row at the
bottom of the table. Keep digits after the decimal point for floatingpoint values.
Submit your completed CSApy file on Canvas.
Note that:
You can do everything in the main program, or write your own functions if necessary not required
but you must use the given starter code to begin.
You may use any of the Python class methods as well as other builtin functions, but NOT any
internal or external packages ie no import statement is allowed in your script
Please include comments throughout the body of your program to explain what the code is doing.
Furthermore, if you write functions, please include documentation for each function using docstrings.
You are expected to use repetition statements whenever possible. For instance, if you manually add
up the values in a column using a large addition expression, it will be considered hardcoding. You can
refer to Ch of the class notes regarding how to iterate over a multidimensional list.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
