Python, Programming, Data Science, Artificial Intelligence, Data.
ConcreteStrategyAdd(Strategy): def execute(self, a, b): return a + b class ConcreteStrategySubtract(Strategy): def execute(self, a, b): return a - b class ConcreteStrategyMultiply(Strategy): def execute(self, a, b): return a * b class Context: def __init__(self, strategy): self._strategy = strategy