Python_Institute
PCPP-32-101 · Question #63
Select the correct statements about the csv module. (Choose two.)
The correct answer is B. The DictReader method always gets the header from the first line in the file. D. A reader object maps each row to a list of strings. csv.DictReader reads the header from the first line by default to map column names to values. A csv.reader object returns each row as a list of strings.
Working with Files
Question
Select the correct statements about the csv module. (Choose two.)
Options
- AA DictReader object maps each row to a diet.
- BThe DictReader method always gets the header from the first line in the file.
- CIt is possible to create a DictWriter object without specifying a header.
- DA reader object maps each row to a list of strings.
How the community answered
(35 responses)- A3% (1)
- B91% (32)
- C6% (2)
Explanation
csv.DictReader reads the header from the first line by default to map column names to values. A csv.reader object returns each row as a list of strings.
Topics
#csv module#DictReader#DictWriter#file parsing
Community Discussion
No community discussion yet for this question.