colidescope

/guides/ 05-flow-control-00-intro

Welcome! You are not currently logged in. You can Log in or Sign up for an account.

Conditionals and Loops

This guide will cover the basic of "imperative" programming in Python - controlling the flow of your code using loops and conditionals

Introduction

In this guide, 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.

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.

Sections in this guide

Conditionals and Loops
1Conditionals
1Loops
2Exercise: Attractor Points