Lab 5: Loops

Solutions

Worksheet solns

A simple diagram of the flow of a loop A flowchart showing that when entering a loop, the loop condition is evaluated, and if it is false, the program continues past the loop. However, if the condition is true, the loop executes the loop body (conditional code) and then returns to the start of the loop where it proceeds to check the conditinon again.
 
A more engaging example of a loop in action A short animation of two hands holding an anthropomorphic bao (a kind of Chinese bun); the hands bring the bao closer to the viewpoint as the bao smiles and waves its arms.
[From the Pixar short: Bao]

No download folder needed for today's lab

Start a new file called lab05.py on your computer. All your code for today's lab can go in this file.

Table of Contents

Big Questions