Привет, я новичок в python Я все время получаю TypeError: Question () не принимает аргументов
Traceback (последний вызов последним): File "/ Users / adriankelsey / PycharmProjects / LearningPython / Создание Тест с множественным выбором / app.py ", строка 10, в вопросе (question_prompts [0]," a "), TypeError: Question () не принимает аргументов
Это Question.py
class Question:
def __int__(self, prompt, answer):
self.prompt = prompt
self.answer = answer
Это в app.py
from Question import Question
question_prompts = [
"What color are apples?\n(a) Red/green\n(b) Purple\n(c) Orange\n\n",
"What color are bananas?\n(a) Teal\n(b) Magenta \n(c) Yellow\n\n",
"What color are strawberries?\n(a) Yellow\n(b) Red\n(c) Blue\n\n"
]
questions = [
Question(question_prompts[0], "a"),
Question(question_prompts[1], "c"),
Question(question_prompts[2], "b"),
]
def run_test(questions):
score = 0
for question in questions:
answer = input(question.prompt)
if answer == question.answer:
score += 1
print("You got " + str(score + "/" + str(len(questions) + " correct")))
run_test(questions)