Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please write code in Newest version of Python (Data file not needed) You are goi

ID: 3696676 • Letter: P

Question

Please write code in Newest version of Python

(Data file not needed)

You are going to compute a grade for each line of data in the selected file that is valid. To do this you will be using an answer key which contains all of the correct answers for the exam - here is a string that represents this key:

Your program should use this key to compute a score fo each valid line of data. Scores can be computed as follows:

+4 points for every right answer

0 points for every skipped answer

-1 point for every incorrect answer

You will also want to compute the following statistics for the entire class:

The average score

The highest score

The lowest score

The range of scores (the higest minus the lowest)

Hint: once you've scored the students you should use a list to store indivdual student scores - you can then compute statistics after you've examined every student in the file.

Here is a sample running of your program for the first two data files. A complete listing of the expected output for all data files can be found in the downloadable package for this assignment.

Sample of Data file class1.txt:

N00000001,A,A,D,D,C,D,D,A,,C,D,B,C,,B,C,B,D,A,C,,A,,C,D
N00000002,,A,,D,,B,D,A,C,C,D,,A,A,A,C,B,D,C,C,A,A,B,,D
N00000003,B,A,,D,C,B,D,A,C,C,,B,A,B,A,C,B,D,A,,A,,B,D,D
N00000004,B,B,D,,,B,D,A,C,C,D,B,A,B,A,C,B,D,,C,A,D,B,C,D
N00000005,B,A,,D,,B,D,A,C,C,D,B,A,B,A,C,B,D,D,C,A,A,,D,D
N00000006,B,A,D,A,C,B,D,A,C,C,C,B,A,D,A,C,,C,A,C,A,C,B,D,A
N00000007,B,A,D,D,C,B,D,A,C,,D,B,A,B,A,C,B,D,,C,A,A,B,D,
N00000008,A,A,D,D,C,,D,A,C,C,B,C,A,B,A,A,B,D,A,C,A,,B,B,D
N00000009,B,A,,D,C,B,D,A,C,A,D,B,A,B,A,A,B,D,A,C,A,A,B,D,D
N00000010,,A,D,B,C,B,D,A,C,C,D,B,A,B,A,C,B,D,A,D,,,B,D,B
N00000011,B,A,D,,C,B,D,A,C,D,D,B,A,B,A,C,B,D,A,C,A,B,B,D,D
N00000012,B,,D,D,C,B,D,A,C,C,D,B,A,B,A,A,B,D,A,,A,A,A,,C
N00000013,,A,D,,B,B,,A,C,A,D,B,A,B,D,C,B,D,A,C,A,A,B,D,D
N00000014,B,B,D,D,C,B,,D,C,C,D,B,A,B,A,C,,D,A,C,A,A,,D,D
N00000015,A,C,C,D,C,B,,A,C,C,D,B,A,B,A,C,B,D,A,C,A,B,,D,D
N00000016,B,A,C,D,,B,D,A,C,C,D,B,A,B,A,C,B,D,A,C,A,A,B,D,D
N00000017,B,A,D,D,C,B,C,A,D,C,D,A,A,D,A,C,B,D,D,B,,A,B,D,D
N00000018,B,A,D,A,C,B,D,A,C,C,D,B,A,B,,,B,D,A,B,A,A,B,,D
N00000019,B,A,D,D,C,B,D,C,C,C,,B,,B,D,C,B,D,A,,A,A,B,D,D
N00000020,B,,D,D,C,B,D,A,C,B,,,A,C,A,D,B,D,B,C,A,A,B,D,D

Explanation / Answer

>> a = [] # Define an empty >> a.append(5) # Adds a new element to a list. >> a.append(3) >> a.append(7) >> len(a) # Find length of the list. 3 >> a[0]*a[2] # Indexing of list starts from 0. 35 >> a.pop() # Removes the last element of the list and returns its value. 7 >> a.remove(5) # Removes the first occurrence of the element from the list. >> a [3] >> a.extend([3,2]) # Appends a list at the end of another list. >> a [3, 3, 2]