Chapter 13: Python and CSV files - Online Test

Q1. A CSV file is also known as a ….
Answer : Option A
Explaination / Solution:
No Explaination.


Q2. The expansion of CRLF is
Answer : Option D
Explaination / Solution:
No Explaination.


Q3. Which of the following module is provided by Python to do several operations on the CSV files?
Answer : Option C
Explaination / Solution:
No Explaination.


Q4. Which of the following mode is used when dealing with non-text files like image or exe files?
Answer : Option B
Explaination / Solution:
No Explaination.


Q5. The command used to skip a row in a CSV file is
Answer : Option A
Explaination / Solution:
No Explaination.


Q6. Which of the following is a string used to terminate lines produced by writer()method of csv module?
Answer : Option A
Explaination / Solution:
No Explaination.


Q7.

What is the output of the following program? import csv d=csv.reader(open('c:\PYPRG\ch13\city.csv'))

next(d)

for row in d: print(row)

if the file called “city.csv” contain the following details

chennai,mylapore

mumbai,andheri

Answer : Option B
Explaination / Solution:
No Explaination.


Q8. Which of the following creates an object which maps data to a dictionary?
Answer : Option D
Explaination / Solution:
No Explaination.


Q9. Making some changes in the data of the existing file or adding more data is called
Answer : Option C
Explaination / Solution:
No Explaination.


Q10.

What will be written inside the file test.csv using the following program import csv

D = [['Exam'],['Quarterly'],['Halfyearly']]

csv.register_dialect('M',lineterminator = '\n')

with open('c:\pyprg\ch13\line2.csv', 'w') as f:

wr = csv.writer(f,dialect='M')

wr.writerows(D)

f.close()

Answer : Option D
Explaination / Solution:
No Explaination.