Lab 13: Knowledge Check

These questions check your knowledge of concepts from this lab. Use the button at the bottom to show your answers once you've attempted them.

  1. Data read from a CSV file is always a string, even when the file contains entries that are numeric.
    True False
  2. JSON and CSV are different because... (pick one or more)
    1. ...JSON files are smaller than CSV files.
    2. ...JSON files can store lists and dictionaries directly, while CSV files cannot.
    3. ...they aren't fundamentally different: JSON files are just CSV files with extra formatting requirements.
    4. ...CSV files are read line-by-line, whereas JSON files can store the same data on one line or split across multiple lines.
  3. When setting up a `csv.DictReader`, what do you need to have ready?
    1. A list describing the names of the columns you will read.
    2. An empty list to put results in.
    3. The filename of the file that you want to read from.
    4. An open file-writer object to write results from the reader.
    5. An open file-reader object to use as the basis for the `DictReader`.

Table of Contents