diff --git a/pydatastructs/linear_data_structures/arrays.py b/pydatastructs/linear_data_structures/arrays.py index 2e0c3fd9..61aac240 100644 --- a/pydatastructs/linear_data_structures/arrays.py +++ b/pydatastructs/linear_data_structures/arrays.py @@ -421,6 +421,9 @@ def delete(self, idx): @property def size(self): return self._size + + def __len__(self): + return self._num def __str__(self): to_be_printed = ['' for _ in range(self._last_pos_filled + 1)]