Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
spencer tintorri6,184 Points
Why does ```hand.die_class``` and ```hand.size``` throw an AttributeError
We set size=5 and die_class=D6, but we get "AttributeError: 'Hand' object has no attribute 'size' / 'die_class' "
hand = Hand(size=5, die_class=D6) print(hand.value) print(len(hand)) print(hand.die_class)
Steven Parker217,443 Points
The arguments passed to create a new instance don't automatically become attributes in the class. Based on the code, they might, but this code doesn't retain either argument that way.
The "size" argument determines how many objects will be initially stored in the Hand, and "die_class" determines what kind of objects they will be.