Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1name,year,house | AOne record on a single line, with three fields separated by commas | |
| 2Ava,7,Red | BAva;7;Red | |
| 3Text that contains a comma is wrapped in double quotes so the comma is not treated as a delimiter | CA header row: the first line lists the field names, separated by commas | |
| 4A delimiter other than a comma, such as a semicolon, can separate the fields in a delimited file | D"Nguyen, Ava",7,Red | |
| 5Nguyen, Ava,7,Red | EThe comma inside the name is not quoted, so it is read as a delimiter and the line splits into four fields instead of three. Fix: "Nguyen, Ava",7,Red | |
| 6name,year,house Ava,7,Red | FThe header and the record are on the same line. Each record must be on its own line, so the header and the record need a line break between them. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
CSV — A text file with one record per line, fields split by a delimiter such as a comma, and an optional header line of field names. Text containing commas goes in quotes.fields = line.split(",")delimiter = ";"
fields = line.split(delimiter)header = lines[0]
records = lines[1:]recordCount = len(lines) - 1line = ",".join(fields)