Skip to main content Link Search Menu Expand Document (external link)

Files

This week we’re dealing with files. Files are one way to make data persistent - to store data separately from the program, which the program can then access. Files can also be a useful way to separate content (data) from the workings of the program (code).

Readings

Also, please re-read (skim) the following readings about dictionaries:

Summary

For this week’s summary, think about what you already know about other ways of storing data in Python, like variables, lists, and dictionaries. How are files different?

Summary prompt: What kinds of data do you think might be useful to store in a file? Why would you want to use a file rather than storing data in a variable inside of a program?

Question

As per usual, your question can be one of three types:

  • Confusion: what didn’t you understand in the readings?
  • Curiousity: what do you want to know more about?
  • Connection: how does this topic connect to your own experiences?

Submit your summary+question on D2L under Quizzes before class starts on Tuesday.