[Solved] infinite loop until one of three conditions is True. Python
You can add an if condition inside an infinite while loop to break out of it. Also your run_test() function must return the score, see below: class Question: def __init__(self, prompt, answer): self.prompt = prompt self.answer = answer def run_test(questions): score = 0 for question in questions: while True: answer = input(question.prompt) if answer in … Read more