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

I have a lab assignment for my intro to programming class using python. In this

ID: 3740819 • Letter: I

Question

I have a lab assignment for my intro to programming class using python. In this lab we are supposed to read in a text file with grades.

The text is this:

Homework 10% 40/40, 10/40,30/40, 4/5,18/40,40/40,76/80,10/10
Quizzes 10% 10/10,10/10,8/10,9/10,0/10,10/10,6/10
Tests 35% 89/100, 97/100
Projects 30% 56/60,60/60
Final 15% 495/550

**We are not allowed to edit the above text**

I already have functions that can work compute the averages of the lists, weights, and the final grade. But I cant seem to get this part working correctly. I need to separate the score lists into scores earned and total scores. But I am hitting a wall. Any help is appreciated.

This is my current code:

def get_file(fileName): 1 score_dict - th infile - open(fileName , 'r') for line in infile: lines-line.strip() lines-line.split(' ') items'".join(lines [2:]) itemsitems.rstrip() items items. split(' , ? ) score dict [lines [01items return score dict

Explanation / Answer

def get_file(fileName)
score_dict={}
infile=open(fileName,'r')

lines=line.strip()
lines=line.slipt()
lines=''.join(lines[2:])
lines=item.rstrip()
item=item.slipt(',')
score_dict[line[0]]=item
return score_dict