City Dancers ============ We have information about swing dancers in two dictionaries: - The first one, let's call it ``dni_dan_D``, associates to the DNI (:class:`str`) of a dancer, the list of the swing dances he/she likes to dance. - The second one, let's call it ``dni_D``, associates to the DNI (:class:`str`) of a dancer, a list with the personal info of the dancer, which, to make it simple, consists of two :class:`str` with the name and the city of the dancer. For example, .. literalinclude:: gen_city_dancers_D-test.txt :language: python3 :start-after: --input-ini :end-before: --input-fi You are required to implement the following functions in the module :mod:`city_dancers.py` (file :file:`city_dancers.py`). Bear in mind that the fist function is 80% and the second is 20%: Generate Dancers dict --------------------- .. py:function:: gen_city_dancers_D(dni_dan_D, dni_D, d) such that **given** - ``dni_dan_D`` a :class:`dict` as described above, - ``dni_D`` a :class:`dict` as described above, - ``d`` a name of a swing dance (:class:`str`), **returns** a :class:`dict` where the keys are city names that are associated to a list of the names of the dancers in that city that like to dance ``d``. In the event that a dancer in ``dni_dan_D`` that dances ``d`` does not appear in ``dni_D``, their DNI will be included in a list of DNIs associated with the ``Unknown`` key. If this case never occurs then the ``Unknown`` will not appear in the resulting dictionary. Here is an example doctest: .. literalinclude:: gen_city_dancers_D-test.txt :language: python3 :start-after: --output-ini :end-before: --output-fi You will find more tests in the :download:`gen_city_dancers_D-test.txt ` file. Sort Dancers lists ------------------ .. py:function:: ord_city_dancers_D(cd_D) such that **given** a :class:`dict` ``cd_D`` as the one produced by the previous function ``gen_city_dancers_D`` **modifies** ``cd_D`` such that all the lists of names of dancers are alphabetically ordered. Here is an example doctest: .. literalinclude:: ord_city_dancers_D-test.txt :language: python3 You will find more tests in the :download:`ord_city_dancers_D-test.txt ` file.