Thanks! I am going to figure out the tagging part better. I have played around making multiple choices and some other ideas as well. I will add more questions later, now it is more about learning.
What I am trying to solve is that for each question in the quiz I have to copy/paste the code manually again. My thinking was that there must be a way to automate that.
First time: questionList[0]
Second time: questionList[1]
and so forth...
But perhaps it is a non-issue! :)
This is what it looks like at the moment:
What I am trying to solve is that for each question in the quiz I have to copy/paste the code manually again. My thinking was that there must be a way to automate that.
First time: questionList[0]
Second time: questionList[1]
and so forth...
But perhaps it is a non-issue! :)
This is what it looks like at the moment:
class Question: def __init__(self, question, answer): self.question = question self.answer = answer questionList = [] questionList.append(Question("What is the capital of Colombia", "Bogota")) questionList.append(Question("What is the capital of Chile?", "Santiago")) print(questionList[0].question) for i in range(3): answer = input("Response: ") if answer == (questionList[0].answer): print("Correct answer") break if answer != questionList[0].answer: continue else: print("Wrong Answer") print() print("The correct answer was:", questionList[0].answer) print(questionList[1].question) for i in range(3): answer = input("Response: ") if answer == (questionList[1].answer): print("Correct answer") break if answer != questionList[1].answer: continue else: print("Wrong Answer") print() print("The correct answer was:", questionList[1].answer)