def read_file(): with open('questions.txt') as f: lines = f.readlines() question_list = [] for line in lines: question, answer = line.strip().split('=') question_list.append((question, answer)) return question_list import random print(random.random("questions.text"))
## Part 7: Tests ### Test 1: - Test that a user gets asked a question ### Test 2: - Test that a user gets asked a question and can answer a question ### Test 3: - Test that a user gets asked a question, can answer a question and gets a new question after answering a question ### Test 4: - Test that a user gets asked a question, can answer a question and gets a new question after answering a question, and the number of questions answered is tracked ### Test 5: - Test that a user gets asked a question, can answer a question and gets a new question after answering a question, and the number of questions answered is tracked, and the score is tracked ### Test 6: - Test that a user gets asked a question, can answer a question and gets a new question after answering a question, and the number of questions answered is tracked, and the score is tracked and the game ends after 5 questions ### Test 7: - Test that a user gets asked a question, can answer a question and gets a new question after answering a question,