Outline for April 27, 2009

Reading: §6.5–6.7


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