MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / AddNode

Class AddNode

example_code/item_049.py:113–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112print("Example 8")
113class AddNode(Node):
114 def __init__(self, left, right):
115 self.left = left
116 self.right = right
117
118 def evaluate(self):
119 left = self.left.evaluate()
120 right = self.right.evaluate()
121 return left + right
122
123class MultiplyNode(Node):
124 def __init__(self, left, right):

Callers 1

item_049.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected