def execute(self, options: argparse.Namespace) -> None: if 'seed' in options: self.seed = options.seed if 'games' in options: self.games = options.games data = ch13_r05.roll_iter(self.games, self.seed) game_statistics = ch13_r06.gather_stats(data) print(game_statistics)
def summarize_games( total_games: int, *, seed: int = None ) -> Counter[Outcome]: game_statistics = gather_stats( roll_iter(total_games, seed=seed)) return game_statistics