.. role:: python(code) :language: python .. index:: itertools .. `itertools `_ .. _`sec:itertools`: Iterator tools -------------- The `iterator tools `_ :python:`itertools` module especially regroups several combinatoric iterators which can be useful. .. admonition:: Exercise (easy) In the :ref:`project assignment ` exercise, the student picking order matters. The first to pick is certain to get his preferred choice, the second is certain to get at least his second preferred, etc Create a generator which yields every picking order possible. .. _`ex:itertools`: .. collapse:: Correction .. literalinclude:: ../../../../src/tools_methods/useful_modules/iterators.py :pyobject: yield_all_possible_choosers_order :name: yield_all_possible_choosers_order :linenos: :caption: src .. literalinclude:: ../../../../tests/tools_methods/useful_modules/test_iterators.py :pyobject: test_yield_all_possible_choosers_order :name: test_yield_all_possible_choosers_order :linenos: :caption: tests