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.

Python

I believe there was a typo error in the video in the class method part of the code.

In the video, while appending the Books class to the books list, the code is using Book rather than using Books. Please see the code below which I copied from the lecture:

class Books:

@classmethod def create_bookcase(cls,book_list): books = [] for title, author in book_list: books.append(Book(title, author)) #Notice the class name Book but the actual name is Books return cls(books)

I guess I added this post to the wrong forum. sorry,

1 Answer

andren
andren
28,538 Points

Is this question about the code shown in the Constructicons video?

In that video the classes are named Book and Bookcase, there is no Books class. Are you sure you didn't just misread the name of the class while watching the video?