6. Control structures#

So far, all code has been executed sequentially - all lines of script have been executed in order in which they are written in file. This section covers program flow control:

  • branching with if/elif/else

  • repeating actions using for and while loops

  • exception handling with try/except