Outline for April 27, 2009
Reading: §6.5–6.7
- Example: calculating perimeter of a triangle given three points
(see peri3.py)
- Modifying parameter lists
- Not directly (see modpar1.py)
- Using lists (see modpar2.py)
- Why it works
- Why use functions?
- Save repetition (see peri3.py)
- Modularity: top-down design
- Example: print individual scores from a file, and average score
(see pravg.py)
- First step: read in score, print it and name neatly out
- Next step: print it and name neatly out, append score to list
- Final step: divide sum of numbers in list by number of numbers in list