ABSTRACT

In order to be able to do something useful, programs must have some mechanism to manage how and when instructions are executed. In the same way that traffic lights control vehicular flow in a street, flow control structures direct that a code portion is executed at a given time. Python has only three flow control structures. There is one conditional and two iteration structures. A conditional structure determines, after an expression evaluation, whether a block of code is executed or not. Iteration structures allow multiple executions of the same code portion. A for cycle executes a code block many times as elements are available in a specified iterable element, while the code under a while cycle is executed until a given condition turns false. The most classic control structure is the conditional one. For Loop control structure allows code to be repeatedly executed while keeping a variable with the value of an iterable object.