Python Object-Oriented Python Advanced Objects Frustration

hello I need some help

I don't how do this
class Liar(list):
    def __init__(self, *args, **kwargs):

    def __len__(self):
        return len(self) - 2

1 Answer

Steven Parker
Steven Parker
200,781 Points

You have the right idea, but to call the "len" method of the parent class, you need to put "super()." in front of it. Otherwise, you're calling yourself which will cause a "recursion loop".

Also, don't forget the underscores for the name "__len__".