LLD - Behavioral Design Patterns — Part 1
Identify the error in the following Strategy pattern implementation:
class Context:
def __init__(self, strategy):
self.strategy = strategy
def execute(self):
return self.strategy.action()
class StrategyA:
def do_action(self):
return 'Action A'
context = Context(StrategyA())
print(context.execute())