P02: Control flow and logicΒΆ

Computer programs become very powerful once we can command their flow of execution. This is done via two primary control structures:

  • Conditionals (if...elif...else) statements that allow the program execution to branch based on conditions that are met, and

  • Loops (for and while) that allow the program execution to repeat either a fixed number of times (for loops) or until some condition is met (while loops).

  • Overview of topics:

    • conditionals (if, elif, else)

    • comparison operators

    • logic operators

    • for loops

    • while loops