Python - Conditionals and Loops

In this module, we will learn two basic types of 'flow control' structures that will allow us to control how the code within our scripts is executing and allow us to start writing more complex algorithms.

Introduction

Now that we understand Variables, we can start to develop more complex code structures which can build more interesting functionality into our scripts. Up to this point, our scripts have been pretty basic, and limited to only executing in a top-down order, with one command or operation per line. The following two concepts — Conditionals and Loops — are the two basic 'flow control' structures which can actually alter the sequence in which our code is executed, thereby creating more complex behavior and more interesting functionality.