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 trialAntonio Bello
Courses Plus Student 12,601 Pointsnot working error keys getting thrown when i enter self.slots.sort()
Not sure what is wrong here
class Inventory:
def __init__(self):
self.slots = []
def add_item(self, item):
self.slots.append(item)
class SortedInventory(Inventory):
def __init__(self):
super().__init__()
def add_item(self,item):
super(SortedInventory,self).add_item(item)
self.slots.sort()
1 Answer
Steven Parker
231,248 PointsThe arguments to "super" are unnecessary (and apparently ignored), as is the override of "__init__
". But I tried pasting this code directly into the challenge with no changes and it passed.
Try restarting your browser, I've heard that can help in cases of "false failure".
Nick B.
Full Stack JavaScript Techdegree Graduate 31,101 PointsNick B.
Full Stack JavaScript Techdegree Graduate 31,101 PointsEnglish is not my first language so please bare with me.
This is where things go wrong. You wanna don't need to use def init anymore here. Just go ahead and erase that. You wanna replace it with def add_item, call super after that then sort the list in the end
I'll give you a hint.