Monday, September 8, 2008

Flow of control

The most significant thing we talked about today was flow of control, which refers to the order in which statements in a Python program are executed. The normal sequence is from line to line. However, when a loop is encountered, then control cycles through the statements in the loop until the loop terminates.

We finished up the program to compute where to put a hook so that a picture hangs with its center exactly 5 feet above the floor. We also looked at two models for assignment—the sticky note model and the box model. The former is true to Python, but the latter is easier to understand and will work fine as long as we are working with only numbers and strings.

No comments: