First post! I need help with freecodecamp quiz app

I am just learning to code, and maybe this project was a bit too much at once, but I think I did everything right. I was trying to make the quiz game with ui Quiz Game with UI but when I try to run the main.py file I get the error:

Blockquote
File “C:\Users\loomi\Python Stuff\Scratch\Projects\Quiz_Game\quiz_ui.py”, line 32, in init
self.display_options()
File “C:\Users\loomi\Python Stuff\Scratch\Projects\Quiz_Game\quiz_ui.py”, line 88, in display_options
for option in self.quiz.current_question.choices:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘Question’ object has no attribute ‘choices’

And the .choices is grey in my VSC window. The only “choices” attribute I can find in all the code is in the main.py code. In the quiz_ui.py code the .buttons() in self.buttons() is also greyed out. I checked the code posted in the github and it looks the same so I don’t know where the issue is, although I can’t say I really understand everything that’s going on with all these intersecting parts. I could certainly use some help.

I haven’t changed anything, but now I am getting this error:

Blockquote
Traceback (most recent call last):
File “c:\Users\loomi\Python Stuff\Scratch\Projects\Quiz Game\quiz_ui.py”, line 1, in
class QuizInterface:
File “c:\Users\loomi\Python Stuff\Scratch\Projects\Quiz Game\quiz_ui.py”, line 2, in QuizInterface
def init(self, quiz_brain: QuizBrain) → None:
^^^^^^^^^
NameError: name ‘QuizBrain’ is not defined

“from quiz_brain import Quizbrain” is the second line of the quiz_ui.py code, so I don’t know why it isn’t being defined.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.