Travis John Villanueva5,052 Points
Super! 3/3 - Im lost
I think im lost regarding this problem. The problem require a sorted list after adding an item using a super class method inheriting to its child class. I have applied the inheritance properly and my Sortedinventory inherits that method properly but i dont know how to proceed further as i have this query on my head
My list of problem:
- Once items are added, i should call the slots list to perform slots = slots.sort() however, i dont know where would i call it.
- I have the thought that once i perform the class SortedInventory(Inventory) - did i also call automatically the self.slots
- So, my understanding is this should be easy, call the list that contains the added items can you provide me with a step by step logic?
class Inventory: def __init__(self): self.slots =  def add_item(self, item): self.slots.append(item) class SortedInventory(Inventory): def add_item(self, item): super().add_item(item)
Jordan HooverPython Web Development Techdegree Graduate 59,011 Points
I'm not totally clear on your question, but I think you're overthinking it. Just sort the property after the super method has been called. Make sense?