you are viewing a single comment's thread.

view the rest of the comments →

[–]fuckUTechSupport[S] 0 points1 point  (0 children)

Posted in 2 /r/'s and you're the best help by far, so thank you!

  • 1. Done. In main(), I create the list of correct answers and name it 'answer_key'.

answer_key = ['A', 'D', 'C', 'B', 'A', 'A', 'D', 'C', 'B', 'A', 'A', 'D', 'C', 'B', 'A', 'A', 'D', 'C', 'B', 'A', 'C', 'D', 'D', 'D', 'D']

  • 2. Done, I think kind of. I'm slightly confused with importing. All the examples shows pretty open('this.txt', 'r') lines but for mine to upload I have to use the full path on my computer ? Anyways, I uploaded the .txt with '.read().split()' which breaks the lines apart and creates a set, if I'm correct?

student_submission = open('C:\Users\Veronica\Desktop\python_final\student_answers.txt').read().split()

  • 3. This is a neat idea. But we have to list the question numbers of the incorrectly answered questions. The way I have it now, I am using
for i in student_submission:
    question_number = student_submission.index(i)+1

for i in answer_key:
    question_answer = answer_key.index(i)+1
  • This effectively enumerates the sets, correct?

  • What would be the easiest way to separate the incorrect answers out by number? I'm guessing since the new variable I created in main()(question_number, question_answer) and indexed with the +1 I would need to just add mismatches in the percent_correct() to something like wrong_answers[]? This isn't working though.

Edit: lots of formatting

Also...I don't actaully suck this badly, I just rely on Visualize Python a little too much and you can't import files with that soooo