Contest ======= In a contest we have a list with the ranking of the participants: a list with the names of the participants in descending punctuation order. The participants of this contest face each other in pairs and, depending on the result, they interchange their positions. Save both functions into file :file:`contest.py`. #. Write the **modifier** function :py:func:`change` that takes the current ranking, a :class:`list` of participant's names (:class:`str`), and two more names (:class:`str`) together with their position in the list of names, in this order: ``name1, position1, name2, position2`` and **modifies** the ranking list so that the two given names exchange their position. We can consider that both names are in the given list. Examples: .. literalinclude:: test-contest-1.txt :language: python3 :lines: 3-11 .. note:: More tests are provided in file :download:`test-contest-1.txt`. #. Write the **modifier** function :py:func:`update_ranking` that takes a :class:`list` with the ranking of the participants of the contest and another :class:`list` with the results of a confrontation of two contestants and **modifies** the ranking list according to this result. The second list will always have four elements, the name of a contestant (:class:`str`), an integer with their score (:class:`int`), the name of the other contestant (:class:`str`) and their score (:class:`int`). The winner is the one with the highest score. If the winner appears in the ranking list after the loser, then their positions must be changed. Otherwise the ranking list remains unchanged. In the confrontation list there can be one or two new participants (participants which are not yet in the ranking list). New participants must be placed at the end of the ranking list, in the order in which they come in the confrontation list, previously to compare their scores. This function **must call function** :py:func:`change`. Examples: .. literalinclude:: test-contest-2.txt :language: python3 :lines: 3-21 .. note:: More tests are provided in file :download:`test-contest-2.txt`. .. rubric:: Solution A solution of these functions is provided in file :download:`contest.py ` .