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 Inheritance Super!

Rakesh Bharadwaj
Rakesh Bharadwaj
1,376 Points

For now, though, I need you to create a new class, SortedInventory that should be a subclass of Inventory.

It seems simple but don't understand why it gives error

inventory.py
class Inventory:
    def __init__(self):
        self.slots = []

    def add_item(self, item):
        self.slots.append(item)

class SortedInventroy(Inventory):
    pass
Jamie Marsay
Jamie Marsay
8,320 Points

Hi Rakesh!

You're very close to the solution, but your SortedInventory class is missing a method that Inventory has, namely the init method!

Hope that helps!

James.

1 Answer

Oszkár Fehér
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Oszkár Fehér
Treehouse Project Reviewer

Hi Rakesh

First of all check out if the writing it's correct, SortedInventroy it should be SortedInventory, the last "r" it's in the wrong place. it happened with me also this mistakes and the questions are very sensitive for not naming correctly the classes, functions etc, specially when the quiz ask to put this name or that name i hope this helps