Class 9 – Monday, February 4
Look out my window — And see random acts of grace — By everyone
Lest we go forward — Without knowing about lists — We would be wanting
Look both ways
Agenda
- Introduce randomness
- Introduce lists
- Introduce
for
loop
A random example
- Program thats_so_random.py
- Highlights some import random module capabilities
Example to motivate looping
- Program again_and_again.py
- Let's print out one-line-at-a-time, a bunch of the phrase Here I go again
Examples to introduce looping
- Program thats_kinda_stringy.py
- Prints out the characters of a user-supplied string, character by character
- Program thats_amore.py
- Prints out a user-supplied string list of words, one by one
- Program ready_or_not.py
- Prints out the integers 0 to
n-1
for user-suppliedn
; afterwards, prints out the phrase'Ready or not here I come!'
Examples to introduce list capabilities
- Program thats_so_numbing.py
- Introduces list manipulation.
To do list
- Review class artifacts.
- Read the epistle on lists.
- Check out my documentation for the
random
module.
- Check out my documentation for the
list
module.