def __len__(self):
"""
Return number of elements sorted in array
"""
return self.n
To my understanding, we are redefining what the method len
will return for our class. Am I correct or there is a bigger picture?
def __len__(self):
"""
Return number of elements sorted in array
"""
return self.n
To my understanding, we are redefining what the method len
will return for our class. Am I correct or there is a bigger picture?