Listing and Filtering Town Temperatures ======================================= Let's consider a list with information regarding the weather temperatures measured in several towns. The information for each town is represented as a 4-component :class:`tuple` with the following fields: - an identification number (:class:`int`) - the town name (:class:`str`) - a list of temperatures (:class:`list` of :class:`float`) - the updated flag (:class:`bool`): ``True`` is the info is up to date and ``False`` otherwise. For example: .. literalinclude:: list_himax_town.test :language: pycon :start-after: --ini :end-before: --fi You are required to deliver the following functions in the module :mod:`list_town_temp` (file :file:`list_town_temp.py`): ------------------------------------------------------------------------------------------------ The function: .. py:function:: list_himax_town(tL, ref) such that **given** - ``tL``, a :class:`list` as described above - ``ref``, a :class:`float` **returns** a new :class:`list` with the names of the towns whose *maximum temperature* is higher or equal than ``ref``. The names must be alfabetically ordered. For example: .. literalinclude:: list_himax_town.test :language: pycon :start-after: --ini-out :end-before: --fi-out Doctests are available in the :download:`list_himax_town.test` file. .. warning:: The input list **must** remain intact. ------------------------------------------------------------------------------------------------ The function: .. py:function:: list_hiavg_town(tL, ref) such that **given** - ``tL``, a :class:`list` as described above - ``ref``, a :class:`float` **returns** a new :class:`list` with the towns whose *average temperature* is higher or equal than ``ref`` and the temperatures are up-to-date. For each town fulfilling this condition the list must have a 2-place :class:`tuple` with: - The town name. - The average rounded to 2 decimals. The list must be alfabetically ordered by the town name. For example: .. literalinclude:: list_hiavg_town.test :language: pycon :start-after: --ini-out :end-before: --fi-out Doctests are available in the :download:`list_hiavg_town.test` file. .. warning:: The input list **must** remain intact.