Letter counting =============== Save the following functions into a file named ``letters.py``. #. Write the function :py:func:`occurrences` that takes a text (:class:`str`), and returns a dictionary (:class:`dict`) where the key is a lowercase letter or a digit and the value is the number of occurrences of it in the given text. Letters in the given text may be upper or lowercase. This dictionary will not contain any letter that does not appear in the given string, i. e., we must build an incomplete dictionary. See the following examples: .. literalinclude:: test-occurrences.txt :language: python :lines: 3-11 .. note:: More tests are provided in file :download:`test-occurrences.txt`. #. Write the function :py:func:`vowel_occurrences` that takes a text (:class:`str`), and returns a dictionary (:class:`dict`) where the key is a lowercase vowel and the value is the number of occurrences of it in the given text. Letters in the given text may be upper or lowercase. This dictionary will contain all five vowels regardless of wether they are in the text or not, i. e., the dictionary must be complete. See the following examples: .. literalinclude:: test-vowel_occurrences.txt :language: python :lines: 3-9 .. note:: More tests are provided in file :download:`test-vowel_occurrences.txt`. .. rubric:: Solution A solution of these functions is provided in file :download:`letters.py `