def load_questions():
questions = ["Capital of Canada?", "2 + 2 ="]
answers = ["ottawa", "4"]
return questions, answers
def ask(question, answer):
reply = input(question + " ")
return reply.strip().lower() == answer
def show_score(score, total):
print(f"You scored {score}/{total}")
def main():
questions, answers = load_questions()
score = 0
for i in range(len(questions)):
if ask(questions[i], answers[i]):
score = score + 1
show_score(score, len(questions))
main()