Eurovision ========== Save all functions into a file named ``eurovision.py``. The results obtained by Spain at the Eurovision festival are stored in a string with the points given by each country and following the next format: - The country name: 3 alphabetical characters followed by a colon. - The points given by this country: 2 digits. - The text ``' points. '`` (there is a whitespace at the beginning and at the end) Example: ``'FRA:10 points. GBR:03 points. POR:00 points. '`` #. Write the function :py:func:`best_hate` that given a string with the festival results, returns: - An empty string if the given string is empty. - The string 'cheat' if there isn't any 10 points vote. - If the previous conditions aren't met, it returns a string equal to the given string but changing each occurrence of '10 points' for 'we are the best' and each occurrence of '00 points' for 'they hate us'. Examples: .. literalinclude:: eurovision1.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`eurovision1.txt` file. #. Write the function :py:func:`they_hate_us` that given a string with the festival results, returns another string with the first country that gave 00 points to Spain. If there isn't any country that gave 00 points to Spain or the string is empty, this function returns a empty string. Examples: .. literalinclude:: eurovision2.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`eurovision2.txt` file. #. Write the function :py:func:`transform` that given a string with the festival results in the described format, returns another string with a new format: the country name (3 characters), a whitespace, the points without the left hand side zeros, the text ' points' (there is a whitespace at the beginning) and ended with a colon. The last result won't end in a colon. Examples: .. literalinclude:: eurovision3.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`eurovision3.txt` file. #. Write the function :py:func:`score` that given a string with the festival results and another string with the name of a country (3 alphabetical characters), returns an integer with the score given by the country or -1 if there isn't any result. .. literalinclude:: eurovision4.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`eurovision4.txt` file. .. rubric:: Solutions A solution of these functions is provided in the :download:`eurovision.py` file.