Outline for November 7, 2012

Reading: § 12
Assignment Due: Friday, November 9, 2012 at 5:00 PM


  1. String module import string
    1. String constants: string.ascii_letters, string.digits, string.punctuation, string.whitespace
  2. Looping over strings: for i in str
  3. Format strings — see “Printing” handout
    1. Format escapes: %d, %e, %f, %s
    2. Format fields: %3d, %06d, %-6d, %6.2f
    3. Formatted strings: "$%f" % (1.39) prints $1.39
  4. Example [str_array.py]

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