LLD - Behavioral Design Patterns — Part 1
Consider this simplified template method code in Python:
What will be the output when
class Game:
def play(self):
self.start()
self.play_turn()
self.end()
def start(self):
print('Game started')
def play_turn(self):
print('Playing turn')
def end(self):
print('Game ended')
class Chess(Game):
def play_turn(self):
print('Chess turn played')
chess = Chess()
chess.play()What will be the output when
chess.play() is called?