.. py:module:: expenses Traveler expenses ================= The expenses of a traveler are represented in a list of sublists. In each sublist there are one-day expenses (*float* values). The traveler is visiting a single country and the expenses are in the currency of this country. Save the following functions into file :file:`expenses.py`. #. Write function :py:func:`dayexpenses` that takes a list corresponding to the expenses of one day, and modifies it by adding the total spent on that day as the last item of the list. Examples: .. literalinclude:: dayexpenses.txt :language: python3 :lines: 3- .. note:: More tests are provided in file :download:`dayexpenses.txt ` #. Write function :py:func:`expenses` that takes a list of sublists, as described in the first paragraph, and the conversion value of the currency of the visited country in euros, and modifies the given list of sublists in such a way that to each sublist the total spent on that day in euros is added as the last item of the sublist. In addition, this function must return the total spent in euros on that trip. This function must use the previous function :py:func:`dayexpenses`. .. literalinclude:: expenses.txt :language: python3 :lines: 3- .. note:: More tests are provided in file :download:`expenses.txt ` #. Write function :py:func:`dayhighexpense` that takes a list corresponding to the expenses of one day and a certain amount (all in the same currency), and returns the value of the first specific expense that exceeds that amount. If no expense exceeds the given amount this function must return the value 0. .. literalinclude:: dayhighexpense.txt :language: python3 :lines: 3- .. note:: More tests are provided in file :download:`dayhighexpense.txt ` #. Write function :py:func:`highexpense` that takes a list of sublists, as described in the first paragraph, and a given *float* value corresponding to a expense amount (all in the same currency), and returns the first specific expense that exceeds that amount. If no expense exceeds the given amount, the function must return the value 0. This function must use the previous function :py:func:`dayhighexpense`. .. literalinclude:: highexpense.txt :language: python3 :lines: 3- .. note:: More tests are provided in file :download:`highexpense.txt ` .. rubric:: Solution A solution is provided in file :download:`expenses.py `.