Cafeteria ========= The context is a cafeteria shop. Consider the orders including a number of drinks consumed, ``'cafe'`` for example, and foods consumed, ``'donut'`` for example. We need to calculate the price to pay for a given order, with two total figures: the total of drinks and the total of foods. An **order** is represented as a text (:class:`str`) ended by a dot ``'.'`` with exactly **4 items** separated by coma and space ``', '``, although every item can be anything: a drink, a food or something unknown. Each item comes with three informations separated by space (``' '``): - the number of units (positive integer) - the name of a product - the unit price (a float number) For instance, ``'2 cafe_llet 1.80, 3 tallat 1.50, 2 donut 1.55, 2 T-shirt 15.0.'``. To identify whether a *product name* is a drink or a food, two strings with all drink and food names respectively, separated by space (``' '``) are available. For example, .. literalinclude:: cafeta_total_calc.test :language: python3 :start-after: --lists-ini :end-before: --lists-fi Names that do not correspond to any drink or food in this listings should just be disregarded. We wish to get a text indicating the total for drinks and the total for foods to be paid. The format of this text must be ``'The drinks total is XX€ and the foods total is YY€.'`` where ``XX`` and ``YY`` are strings representing float numbers with those totals respectively. In the above exemple, the total of drinks is 8.10 coming from adding the value of 2 ``'cafe_llet'`` s and 3 ``'tallat'`` s. The total of foods is 3.10 for the 2 ``'donut'``. The ``'T-shirt'`` item is disregarded since it is not a food or a drink. ------------------------------------------------------------------------------------------ You are required to deliver the following functions (they have the same grade weight) in the module :mod:`cafeta_module` (file :file:`cafeta_module.py`): Firstly, an auxiliar function specified as follows: .. py:function:: cafeta_total_update(total_drink, total_food, item, drinks, foods) such that **given** - *total_drink*, *total_food*, two :class:`float` indicating the totals for drinks and foods respectively processed so far - *item*, a :class:`str` with an item from an order in the format described above - *drinks*, a :class:`str` with all drink names separated by space (``' '``) - *foods*, a :class:`str` with all foods names separated by space (``' '``) **returns** two :class:`float` with the totals for drinks and foods properly updated by adding the values for the product and amount in *item* according to whether it is a drink or a food (hence, one of the totals will remain the same) For example: .. literalinclude:: cafeta_total_update.test :language: python3 :start-after: --ini :end-before: --fi Doctests are available in the :download:`cafeta_total_update.test` file. ------------------------------------------------------------------------------------------ Secondly, the main function: .. py:function:: cafeta_total_calc(order, drinks, foods) such that **given** - *order* a :class:`str` with the order format described above. - *drinks*, a :class:`str` with all drink names separated by space (``' '``) - *foods*, a :class:`str` with all foods names separated by space (``' '``) **returns** a :class:`str` indicating the totals for drinks and foods corresponding to this order in the format described above. Both totals must be rounded to 2 decimals. For instance, .. literalinclude:: cafeta_total_calc.test :language: python3 :start-after: --ini :end-before: --fi Doctests are available in the :download:`cafeta_total_calc.test` file. .. warning:: This function must be implemented by calling the previous function.