Lesson 9: File I/O

Outline:

  1. Questions?
  2. Goal: draw earthquakes from a file
  3. Aside: strings
    • multi-line strings
    • s.split()
    • practice with strings: Exercise 1
  4. Reading from a file
    • opening and reading files
    • parsing .csv files

Explore after class:

  1. Practice reading from a file
  2. Drawing earthquakes from a file, revisited
  3. Runestone:

What’s next

Upcoming assessments:

  • Homework assignment 4 will be released later today
  • Quiz 2 will be next Friday

What you should do now:

  • The readings (see below)
  • Submit Assignment 3 by 10pm today if you’re using a token
  • Read the description of Assignment 4 this weekend and try to get started

Reading assignment (to be completed by the next class):

  • Zelle sections 10.1–10.2.1 (pp. 297–311)