diff --git a/data_structures/linked_list/singly_linked_list.py b/data_structures/linked_list/singly_linked_list.py index 516facc613eb..4377fc28022a 100644 --- a/data_structures/linked_list/singly_linked_list.py +++ b/data_structures/linked_list/singly_linked_list.py @@ -106,7 +106,7 @@ def __setitem__(self, index, data): raise IndexError("Index out of range.") current = current.next current.data = data - + def __len__(self): """ Return length of linked list i.e. number of nodes