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 Advanced Objects Controlling Conversion

AttributeError: 'Thief' object has no attribute 'name'

I feel as though a lot of steps have been skipped prior to this video. I launched the workspace and followed along,

I am now getting an error:

return "{} : {}".format(self.__class__.__name__, self.name)     

AttributeError: 'Thief' object has no attribute 'name'

https://w.trhou.se/0vvqgbvrcx

1 Answer

Steven Parker
Steven Parker
231,096 Points

It looks like lines 3 and 4 of "characters.py" should be indented a bit more. With the current indentation, line 5 will never be done and it is what would establish the "name" attribute.