Python Object-Oriented Python Dice Roller Yatzy Scoring

Simon Amz
Simon Amz
4,606 Points

Get an AttributeError when running the program

Hi,

I got this error:

Traceback (most recent call last): File "scoresheets.py", line 57, in <module> YatzyScoresheet().score_one_pair(yh) File "scoresheets.py", line 33, in score_one_pair return self._score_set(hand, 2) File "scoresheets.py", line 27, in _score_set for worth, count in hand._sets.items(): AttributeError: 'YatzyHand' object has no attribute '_sets'

when I run the program. I check with the attachment of the teacher and everything is similar.

I don't know why, they told me no attribute '_sets' whereas it is a property and I did precise @property.

thanks for your help

2 Answers

Hi Simon, Please post your code, from all 3 files in the project. That will help us help you.

Simon Amz
Simon Amz
4,606 Points

Hi Mark,

Thanks for your response, I finally find the solution: simple mistake of indention.

Best,