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

Method contains

linked_lists/linked_list.py:35–43  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

33
34 # Returns true if list contains the given value.
35 def contains(self, value):
36 found = False
37 current = self.head_
38 while current and not found:
39 if current.get_data() == value:
40 found = True
41 else:
42 current = current.get_next()
43 return found
44
45 # Deletes all instances of given value in list.
46 def delete(self, value):

Callers 1

mainFunction · 0.95

Calls 2

get_dataMethod · 0.80
get_nextMethod · 0.80

Tested by

no test coverage detected