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
withstatement.
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]
- Everyone may retake Quiz 3
- Wed 10/28: Questions 1–3
- Fri 10/30: Questions 4–6
- I will keep your higher score
- See Unit 3 Review Questions
Activity [40 min]
- Reading/Writing Files – work in pairs
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 PersistencetoSection 8.10 Summary- Do every activity and mark each section as completed
- Read Chapter 8 of Python for Everyone (
- Required before Monday's class:
- PA3: Gift Swap OR PA3: Trivia Night
- Submit to Gradescope until you get 100%
- Don't use AI; visit TA Hours to get help