Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

Wanting to create a small quiz for my students, wondering where I'm going wrong: score = 0 questions = ['What is the colour of Bledisloe?','What is the colour of Carruth?','What is the colour of Hobson?','What is the colour of Marsden?','What is the colour of Grey?'] answers = ['Yellow','Black','Green','Blue','Red']for i in questions: raw_input(i)for j in answers: if i == j:score += 1 print ("Your score is: " + str(score)) #I want to check to see if their raw_input is equal to the answer stored in the variable Answers1 And sorry can't remember how to get it to show up indented and formatted like I've done in IDLE

OpenStudy (anonymous):

I don't think you need to loop through the answers. I would imagine you are expecting a string answer, then you could do if answer in answers: score+=1

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!