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

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -