Python, AI, Software Development, Learn Code, Programming.
return "Bowler is bowling!" class PlayerFactory: def create_player(self, player_type): if player_type == "batsman": return Batsman() elif player_type == "bowler": return Bowler() else: return None # Usage player_factory = PlayerFactory() batsman = player_factory.create_player("batsman") bowler =