Intro to Flow Control#

Flow control and loops are primary concepts in programming, and support the repetition of code blocks multiple times (for and while loops) and control decisions in your code (if).

The flow control and loops are defined by:

  • if/else flow control: these statements allow the execution of a block of code according to True/False conditions

  • for loop: this statement gives a loop interation over a sequence (e.g., list, string, and tuples), and execute a block of code each time with one element of this iterable object

  • while loop: this statement gives a loop in a block of code until a given condition is False

Let’s discuss them!