Python: Lesson 9 Files and Exception 10.0 POINTS
a) Create a list of dictionaries named studentScores similiar to In-Class Example 5d_write_from_csv_dictionary with the following fields:
studentName (string), studentID (integer), exam1 (integer), exam2 (integer), exam3 (integer), exam4 (integer), average (float)
b) Add 3 Entries to the list (making up the data but leaving average as 0.0)
c) Create a loop to update all the averages with the correct value for all 3 Entries. First tally the number of test with a value > 0.
Use that value to calculate the average.
d) Write the list of dictionaries to a file name StudentScores.csv using the csv format.
OUTPUT EXAMPLE 1
File Contents
studentName,studentId,exam1,exam2,exam3,exam4,average
Jorge,11111,80,85,90,95,87.5
Jessie,11122,90,85,90,95,90.0
Jonny,11133,88,85,82,95,87.5
OUTPUT EXAMPLE 2
studentName,studentId,exam1,exam2,exam3,exam4,average
Jorge,11111,0,85,90,95,90.0
Jessie,11122,90,85,90,95,90.0
Jonny,11133,88,85,82,95,87.5