Teaching, Materials, Python, Interactive, Quizzes.
each question, present it to the user, collect their answer, and provide feedback. def run_quiz(): score = 0 for q in questions: answer = questionary.select( q["question"], choices=q["choices"] ).ask() if answer == q["correct_answer"]: print("Correct!") score += 1 else: print("Incorrect.")