What is wrong with my code please?
Now I want you to make a subclass of list. Name it Liar.
Override the len method so that it always returns the wrong number of items in the list. For example, if a list has 5 members, the Liar class might say it has 8 or 2.
You'll probably need super() for this.
class Liar(list): def __len__(self, list1): super().__len__() return (len(list1) - 2)
Alex KoumparosPython Web Development Treehouse Moderator 33,371 Points
You've got the right general idea but the initialiser for len() doesn't take a value (it's operating on self, which is the list instance). This means you need to get rid of the
Instead of working with
list1, you will be working with the value that super's initialiser returns.
Hope that makes sense