✦ MODULE FINAL CHALLENGE

Mini Library Manager 2.0

Your Library. Your Code.

Build a smarter library

  1. Inheritance and super()Initialize EBook with the parent constructor and store the file size.
  2. Method overridingCustomize display_info() so EBook prints its own information.
  3. Special method __str__()Return an EBook description using super().__str__().
  4. Composition and __len__()Add books to Library and make them countable.
  5. Find a bookImplement find_book() to return the matching object or None.
Expected output after completing all tasks:
OutputExpected
Book: Dune
EBook: Python Basics
Total books: 2
Python Basics by Alex Smith (4.5 MB)

Python Playground

Loading Python runtime…
library_manager_2.pyPython
OutputWaiting
Loading Python runtime…

PROJECT CHECK

Check your project

Run five browser-based checks against the behavior of your Book, EBook, and Library classes.

Complete the tasks in the Python editor, run your code, and then check your project. If you get stuck, Sloby can help.

Run the check after you update your code.

  • Inheritance and super()EBook initializes Book values and its own file size.Make sure an EBook stores its title, author, and file_size.
    Waiting
  • Method overriding and polymorphismEBook and Book each provide the right display output.Let EBook.display_info() print its own label while Library.show_books() calls every book.
    Waiting
  • Special method __str__()str(EBook) returns readable book information.Return the title, author, and file size as one string.
    Waiting
  • Composition and __len__()Library stores book objects and counts them.Add each object to self.books and return its number of items.
    Waiting
  • Find a bookLibrary.find_book() returns matching book objects or None.Search the stored objects by title and return the object you find.
    Waiting
Sloby, the Python AI Tutor mascot

Sloby AI Mentor

Sign in for AI project help

Create a free account or sign in to ask Sloby for a hint or code review.