Goals ===== We want to know which **players** have scored in the football leage given the results of the matches. To that purpose we have the following two dictionaries. Firstly, we have a dictionnary with information about the players for each team. Specifically, the key is the name of the team (:class:`str`) and the value is a list with the names (:class:`str`) of all the players in that team. Secondly, we have a dictionnary with the results of the matches in the following form: - The key is a :class:`tuple` with the pair of team names (:class:`str`) that played. - The value is a list where each element represents a goal and has the form of a :class:`tuple` with the minute the goal was scored (:class:`int`) and the name of the player who scored :class:`str`). For example: .. literalinclude:: gen_goal_stats-test.txt :language: python3 :start-after: --ini_in :end-before: --fi_in With this aim, it is requested that in the module :mod:`goals` (file :file:`goals.py`) you do the two following functions. First the function ``gen_goal_stats(Dplayers, Dresults, team)`` such that *given* - ``Dplayers``, a :class:`dict` like the first one described above, - ``Dresults``, a :class:`dict` like the second one described above, - ``team``, a :class:`str`, *returns* a dictionary where the key is the player name (:class:`str`) and the associated value is a list of pairs (:class:`tuple`) with the name of the team he scored against and the minute fo the goal. For example, given the dictionaries above, the call ``gen_goal_stats(Dresults, Dplayers, 'Girona')`` should return the following dict: .. literalinclude:: gen_goal_stats-test.txt :language: python3 :start-after: --ini_out :end-before: --fi_out Test sets are available in the file :download:`gen_goal_stats-test.txt`. Second, the function ``sort_by_minute(Dgoals)`` such that *given* ``Dgoals`` a :class:`dict` like the one generated by the previous funtion **modifies** it leaving the all the goals lists ordered decreasingly by the minute of scoring. For example: .. literalinclude:: sort_by_minute-test.txt :language: python3 :start-after: --ini_sort :end-before: --fi_sort Test sets are available in the file :download:`sort_by_minute-test.txt`.