Patients ======== A file contains a record of the body temperatures of several patients staying in a hospital. The Each line of the file corresponds to a patient and contains the name of the patient (:class:`str`) followed by a (possibly different) number of measured temperatures (:class:`float`) all separated by coma (``','``) . The file :download:`patients.txt ` contains the following example: .. literalinclude:: patients.txt :language: python We need to **filter** the patients whose average temperature (rounded to 2 decimals) falls inside a given closed interval. Implement the following Python function in the module :mod:`patients11` (file :file:`patients11.py`): .. py:function:: filter_fever_interval(pat_fn, pat_in_fn, pat_out_fn, low_b, up_b) such that | **takes** ``pat_fn``, ``pat_in_fn``, ``pat_out_fn``, three :class:`str` with textfile names, and two :class:`float` ``low_b``, ``up_b`` such that ``low_b`` <= ``up_b`` and both are between ``35.0`` and ``40.0``, both included, and does two things: | 1. **writes** two files: one named ``pat_in_fn`` with the information about the patients whose average temperature is in the real numbers closed interval ``[low_b, up_b]`` and another named ``pat_out_fn`` with those patients whose average temperature is strictly outside the interval. The format details of these files are as follows: - The patients must appear in the same order as in the ``pat_fn`` file. - For each patient the must be a line with: all h@s measures, the name, and the average temperature rounded to 2 decimal, all separated by coma (`','`). | 2. **returns** three :class:`int` with: the number of patients processed, the number of patients inside, and the number of patients outside the interval. For example the call ``filter_fever_interval('patients.txt', 'patients-in-37.0-38.0.txt', 'patients-out-37.0-38.0.txt', 37.0, 38.0)`` should return ``(9, 4, 5)`` and create the files :download:`patients-in-37.0-38.0.txt ` and :download:`patients-out-37.0-38.0.txt ` that contain the following texts: .. literalinclude:: patients-in-37.0-38.0.txt :language: python and .. literalinclude:: patients-out-37.0-38.0.txt :language: python .. note:: Notice that the temperatures average must be rounded to 2 decimals before comparing it to ``low_b`` and ``up_b`` values. Doctests are available at the :download:`filter_fever_interval-test.txt` file.