12th Computer Science Chapter- 13 Onemarks Online Test

Question 1: A CSV file is also known as a
A) Flat File
B) 3D File
C) String File
D) Random File
Question 2: The expansion of CRLF is
A) Control Return and Line Feed
B) Carriage Return and Form Feed
C) Control Router and Line Feed
D) Carriage Return and Line Feed
Question 3: Which of the following module is provided by python to do several operations on the CSV files?
A) py
B) xls
C) csv
D) os
Question 4: Which of the following mode is used when dealing with non-text files like image or exe files?
A) Text mode
B) Binary mode
C) xls mode
D) csv mode
Question 5: The command used to skip a row in a CSV file is
A) next()
B) skip()
C) omit()
D) bounce
Question 6: Whuch of the following is a string used to terminate lines produced by writer() method of csv module?
A) Line Terminator
B) Enter Key
C) Form Feed
D) Data Terminator
Question 7: 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
A) chennai, mylapore
B) mumbai, andheri
C) chennai
mumba
D) chennai,mylapore
mumbai,andheri
Question 8: Which of the following creates an object which maps data to a dictionary?
A) listreader()
B) reader()
C) tuplereader()
D) DictReader
Question 9: Naking some changes in the data of the existing file or adding more data us called
A) Editing
B) Appending
C) Modification
D) Alternation
Question 10: What will be written inside the final test.csv using the following program
import csv
D=[['Exam'],['Quaterly'],['Halfyearly']]
csv.register_dialect('M', lineterminator='\n')
with open('c:\pyprg\ch13\line2.csv','w') as f:
  wr=csv.wroter(f,dialect='M')
  wr.writerows(D)
f.close()
A) Exam Quarterly Halfyearly
B) Exam Quaterly Halfyearly
C) E
Q
H
D) Exam,
Quarterly,
Halfyearly

Post a Comment

0 Comments