Python Object-Oriented Python Inheritance Super!

joshua korir
joshua korir
1,445 Points

why is this wrong

inheritance

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

    def add_item(self, item):
        self.slots.append(item)
class SortedInventory(Inventory):
    #pass
    def add_item(item):
        super().add_item(item)

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 56,641 Points

Your are SO close. Remember to include self as the first parameter.

Post back if you need more help. Good luck!!!