This is the P2PU Archive. If you want the current site, go to www.p2pu.org!
The revisions let you track differences between multiple versions of a post.
Flow control consists of tools to determine the sequence of events in a program. The primary aspects of Python flow control include:
Boolean logic - Developed by George Boole, Boolean logic has two values 0 and 1. Boolean statemments in Python will return True or False.
Loops - a loop is a piece of code that is written only once and run many times until a condition is satisfied to end the loop.
Iterators - Iterators allow a program to execute the same code on every element of a group (e.g. check to see if all items in a shopping list are in the shopping cart)
Exercise
Exercise 5.2
http://www.pastie.org/1964328
Final answer?
Final answer? :-)
# Exercise 5.2 totalVal =
Q: What are some physical
Q: What are some physical systems that we see in every day life that exhibit flow control?
A: Opening and closing times of businesses, schools, etc.
------------------
# Excercise 3.1 try: