MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __len__

Method __len__

data_structures/binary_tree/is_sum_tree.py:82–87  ·  view source on GitHub ↗

>>> len(BinaryTree.build_a_tree()) 8

(self)

Source from the content-addressed store, hash-verified

80 return iter(self.root)
81
82 def __len__(self) -> int:
83 """
84 >>> len(BinaryTree.build_a_tree())
85 8
86 """
87 return len(self.root)
88
89 def __str__(self) -> str:
90 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected