Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Object-Oriented Python Dice Roller RPG Roller

Stephen Hutchinson
Stephen Hutchinson
8,426 Points

Bummer! Didn't get a correct value for `Hand.total`?

I tried this code locally and it worked well:

from dice import D20


class Hand(list):

    @property
    def total(self):
        return sum(self)

    @classmethod
    def roll(cls, amount):
        dice = cls()
        for _ in range(amount):
            dice.append(D20())
        return dice

Any ideas why I get that error?

Chris Howell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Chris Howell
Python Web Development Techdegree Graduate 49,702 Points

You will have to post your dice.py as well too if you are still getting an error.

I used your hands.py code from above and passed this challenge. The only thing I added on my own was the class D20 that extends Die.