Control flow ============ Python has a whole range of :term:`control flows ` to control code execution and programme flow, including common branches and loops: :doc:`boolean` check values and identity and allow links between the two. :doc:`conditional` execute the code block after the first true condition of an ``if`` or ``elif`` statement; if neither condition is true, the code block is executed after the ``else``. :doc:`loops` While ``while`` loops are executed as long as the condition is true, ``for`` loops iterate over :doc:`../types/sequences-sets/lists`, :doc:`../types/sequences-sets/tuples` and :doc:`../types/sequences-sets/sets`. :doc:`exceptions` usually deal with errors that occur during the execution of programmes. :doc:`with` regulates access to files, the locking of threads and the suppression of :doc:`exceptions`, among other things. .. toctree:: :titlesonly: :hidden: boolean conditional loops exceptions with