© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
K. WilsonThe Absolute Beginner's Guide to Python Programminghttps://doi.org/10.1007/978-1-4842-8716-3_4

4. Flow Control

Kevin Wilson1  
(1)
London, UK
 

Flow control is controlling the order in which statements or function calls of a program are executed.

There are three control structures: sequence, selection, and iteration.

Python has various control structures such as while loops, for loops, and if statements, which are used to determine which section of code is executed according to certain conditions.

Sequence

A computer program is a set of step-by-step instructions that are carried out in sequence to achieve a task or solve a problem. The sequence can contain ...

Get The Absolute Beginner's Guide to Python Programming: A Step-by-Step Guide with Examples and Lab Exercises now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.