python: compare list containing multiple lists with a single different list -
i solving issue have make program correct evidence. program receives feedback , answers "n" students , compares supplied template. responses of students put single list. problem is, how compare list of responses feedback , print individual score each student.
ex:
answer_teacher = ['a','b','d','e','f'] answer_student = [['a','b','f','e','f'],['a','a','d','e','f'], ...]
without seeing tried im going give answer ... prepared explain solution teacher
print([sum(a==b a,b in zip(student,answer_teacher))*1.0/len(answer_teacher) student in answer_student])
Comments
Post a Comment