Measures ======== A device measures the atmospheric pressure of an exterior zone. When meteorological conditions aren't good, measures aren't reliable, and the device has a sensor that checks whether the meteorological conditions are good or bad. We have been given a non empty :class:`list` of measures, corresponding to a determined time period. This list contains real values (:class:`float`) corresponding to atmospheric pressures, taken in chronological order. This list also contains the characters asterisk (``'*'``) and equals (``'='``). When traversing the list if an asterisk is found, it means that the following measures aren't reliable and if an equal sign is found, it means that the following measures are reliable. The initial values of the given list are reliable. Save the following functions into the same file :file:`measures.py`. #. Write the function :py:func:`separate`, that takes a list of measures as described, and returns a :class:`tuple` with two lists. The first list should only have the reliable measures of the given list and the second list should only have the measures of the given list that aren't reliable. For example: .. literalinclude:: test-measures-1.txt :language: python3 :lines: 3-5 More tests are provided in file :download:`test-measures-1.txt `. #. Write the function :py:func:`average`, that takes a list of real values, and returns the average (:class:`float`) of the list elements. Suppose that the list is not empty. Example: .. literalinclude:: test-measures-2.txt :language: python3 :lines: 3-10 More tests are provided in file :download:`test-measures-2.txt `. #. Write the function :py:func:`averages`, that takes a list of measures as described, and returns a :class:`tuple` with two averages (:class:`float`) corresponding respectively to the average of the reliable measures and the average of all measures. For example: .. literalinclude:: test-measures-3.txt :language: python3 :lines: 3-8 This function :py:func:`averages` must call the previous two functions :py:func:`separate` and :py:func:`average`. More tests are provided in file :download:`test-measures-3.txt `. #. Write the function :py:func:`proportion`, that takes a list of measures as described, and returns the percentage (:class:`float`) of reliable measures with respect to the total number of measures in the given list. For example: .. literalinclude:: test-measures-4.txt :language: python3 :lines: 3-6 This function :py:func:`proportion` must call the previous function :py:func:`separate`. More tests are provided in file :download:`test-measures-4.txt `. .. rubric:: Solution A solution of these functions is provided in file :download:`measures.py `