Class 9 – Monday, Ferbruary 5
Build on the shoulders of giants
Look out my window – And see random acts of grace – By everyone
Look both ways
Agenda
- Introduce the random module
- Introduce the
for
loop
- Introduce lists
Examples
- Program thats_so_random.py
- Introduce some helpful functions from the random module.
- Program again_and_again.py
- Prints out 128 lines of the phrase
'again and again'
.
- Program ready_or_not.py
- Prints out the integers 0 to
n-1
for user-suppliedn
.
- Program thats_a_gauss.py
- Prints out total of integers 1 to
n
for user-suppliedn
.
- Program list_away.py
- Introduces list manipulation.
- Program in_summation.py
- Prints the total of a user-supplied list of numbers.
- Program bit_by_bit.py
- Generates a list of
n
bits (binary digits) for a user-suppliedn
.
To do list
- Review class artifacts
- Read the list epistle
Warning: fopen(/l/cs1112/public_html/defs/htm/181-trailer): Failed to open stream: No such file or directory in /l/cs1112/public_html/defs/php/read.php on line 5
Unable to open file!