List Matching


Submit solution

Points: 10
Time limit: 1000.0s
Memory limit: 12M

Authors:
Problem types
Allowed languages
Python

Imagine you are a teacher and need to grade a multiple-choice test your students have taken. You have a list of answers that each student has given, and you need to write a Python program that takes this list as input and prints each student's score. You can assume that the test has ten questions, each with four options (A, B, C, D). The correct answer for each question is given in another list. Calculate the marks for each student after comparing the student's answers and the correct answers. The first input will be characters representing the answer key. The second input (n) will be an integer representing the number of students. There will be n strings to follow, one in each line representing each student's answers. The output should be a list of the student marks in the order in which the answers were entered.

Sample Input:

ABCDABCDAB
3
ABCDABCDAB
BBCDABCDAC
CBCDABCDAD

Sample Output:

[10, 8, 8]

Comments

There are no comments at the moment.