MCPcopy
hub / github.com/jwasham/practice-python / __len__

Method __len__

linked_lists/linked_list.py:11–17  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9 self.head_ = head_node
10
11 def __len__(self):
12 count = 0
13 current = self.head_
14 while current:
15 count += 1
16 current = current.get_next()
17 return count
18
19 def __str__(self):
20 current = self.head_

Callers

nothing calls this directly

Calls 1

get_nextMethod · 0.80

Tested by

no test coverage detected