Outline for November 21, 2012

Reading: none
Assignment Due: Wednesday, November 30, 2012 at 11:59 PM


  1. Review of slicing, var[start:end]
    1. Value at index end not included in slice
    2. If omitted, start value defaults to 0 and end value defaults to last index + 1
    3. Can use negative index
  2. Example program [strstuff.py]
  3. Recursion review
    1. Key point: Function must call itself within its own body — if it doesn’t do this, it is not recursive
    2. How to do it
  4. Example 1: length of a string [recfun.py]
  5. Example 2: only alphabetic characters in a string [recfun.py]
  6. Example 3: find largest integer in a list of integers [recfun.py]
  7. Example 4: make a string from the words in a list [recfun.py]
  8. Example 5: reverse a string [recfun.py]


A PDF version is available here.
ECS 10, Basic Concepts of Computing
Fall Quarter 2012