Skip to content

Oct 26: Reading and Writing Files

Meet in King 248

Learning Objectives

After today's class, you should be able to:

  • Create a new text file, and output several lines to the file.
  • Open an existing file, and append several lines to the file.
  • Read a text file line by line, using a with statement.

Lesson Outline

Homework [5 min]

  • The Week 10 reflection is optional
  • Instead, this week's homework is:
    • 10 pts on Runestone (Read 8.1–8.10)
    • 20 pts on Gradescope (PA3 score ÷ 2)
  • See "Your To-Do List" below

Quiz 3 [5 min]

Activity [40 min]

Your To-Do List

  • Prepare to retake Quiz 3 (1–3)
  • Required before Friday's class:
    • Read Chapter 8 of Python for Everyone (mayfield1)
    • Section 8.1 Persistence to Section 8.10 Summary
    • Do every activity and mark each section as completed
  • Required before Monday's class: