Marks ===== A :class:`list` of marks corresponding to an exam consists of sublists of two elements: the student identifier (:class:`str`) and their mark (:class:`float`). You may suppose that the list is not empty. Save the following functions into the file :file:`marks.py`: #. Write the function :py:func:`search_ident` that takes a :class:`list` of marks and a student identifier (:class:`str`), and returns ``True`` if the given identifier belongs to the list and ``False`` otherwise. Examples: .. literalinclude:: test-marks-1.txt :language: python3 :lines: 3-9 .. note:: More tests are provided in the file :download:`test-marks-1.txt`. #. Write the function :py:func:`search_mark` that takes a :class:`list` and a mark (:class:`float`), and returns ``True`` if there is at least one student having this mark and ``False`` otherwise. Examples: .. literalinclude:: test-marks-2.txt :language: python3 :lines: 3-9 .. note:: More tests are provided in the file :download:`test-marks-2.txt`. #. Write the function :py:func:`perc_passed` that takes a :class:`list` of marks, and returns the percentage (:class:`float`) of students who have passed the exam. Examples: .. literalinclude:: test-marks-3.txt :language: python3 :lines: 3-11 .. note:: More tests are provided in the file :download:`test-marks-3.txt`. #. Write the function :py:func:`best_worst_mark` that takes a :class:`list` of marks, and returns the best mark (:class:`float`) and the worst mark (:class:`float`) in the list. Examples: .. literalinclude:: test-marks-4.txt :language: python3 :lines: 3-14 .. note:: More tests are provided in the file :download:`test-marks-4.txt`. #. Write the function :py:func:`mark_distribution` that takes a :class:`list` of marks, and returns another :class:`list` with 11 items that represents the marks distribution between 0 and 10. The first item in the list will be the number of marks belonging to the interval [0, 1[; the second item will be the number of marks belonging to the interval [1, 2[; and so on. The last (11th) item will contain the number of marks equal to 10. Examples: .. literalinclude:: test-marks-5.txt :language: python3 :lines: 3-14 .. note:: More tests are provided in the file :download:`test-marks-5.txt`. #. Write the function :py:func:`best_students` that takes a :class:`list` of marks, and returns another :class:`list` with the identifiers (:class:`str`) of those students whose mark is 10. This list must be sorted increasingly. Examples: .. literalinclude:: test-marks-6.txt :language: python3 :lines: 3-14 .. note:: More tests are provided in the file :download:`test-marks-6.txt`. #. Write the function :py:func:`sort_ident` that takes a :class:`list` of marks, and returns a :class:`list` with the same items sorted by increasing identifiers. Examples: .. literalinclude:: test-marks-7.txt :language: python3 :lines: 3-6 .. note:: More tests are provided in the file :download:`test-marks-7.txt`. #. Write the function :py:func:`sort_marks` that takes a :class:`list` of marks, and returns a :class:`list` with the same items sorted by increasing marks firstly and increasing identifiers secondly. Examples: .. literalinclude:: test-marks-8.txt :language: python3 :lines: 3- .. note:: More tests are provided in the file :download:`test-marks-8.txt`. #. Write the function :py:func:`average` that takes a :class:`list` of marks, and returns the average mark (:class:`float`). Examples: .. literalinclude:: test-marks-9.txt :language: python3 :lines: 3- .. note:: More tests are provided in the file :download:`test-marks-9.txt`. .. rubric:: Solution A solution of these functions is provided in the file :download:`marks.py `.