Jan-21-2019, 09:27 PM
It is very tough on me because I like to search out the best or most efficient way to do something but in this class we are not allowed/rewarded for doing so. She seems to think if she didn't teach it to us then there is no way for us to know how to use it. I commented out the read file to empty list part of the program and copied the info to the list to make it easier for help.
CORRECT_ANSWERS = ["A" , "C" , "A" , "A" , "D" , "B" , "C" , "A" , "C" , "B" , "A" , "D" , "C" , "A" , "D" , "C" , "B" , "B" , "D" , "A"] student_answers = ["A" , "C" , "A" , "A" , "A" , "B" , "C" , "A" , "C" , "C" , "A" , "D" , "C" , "A" , "A" , "C" , "B" , "B" , "D" , "D"] #student_file = open("test.txt" , "r") #for line in student_file: # student_answers.append(line.rstrip('\n')) #student_file.close() correct_answers = 0 for index in CORRECT_ANSWERS , student_answers: if CORRECT_ANSWERS[0] == student_answers[0]: correct_answers += 1 print(correct_answers)I am getting an output of 2 and it should be 16 for the correct_answers. What am I missing here?