15 extra multiple-choice questions for Python and CSV files (12th Standard Computer Science, Samacheer Kalvi), beyond the ones printed in the textbook — each with the correct option highlighted and a clear, worked explanation. Free to read in English and Tamil.
Q1
Which of the following file extensions is used for saving a Comma-Separated Values file?
- A. .xls
- B. .xlsx
- C. .csvCorrect
- D. .txt
Explanation. A Comma-Separated Values file is plain text and uses the .csv extension.
Q2
What is another name commonly used to refer to a CSV file because of its plain, tabular structure?
- A. Binary File
- B. Flat FileCorrect
- C. Relational File
- D. Rich Text File
Explanation. A CSV file is also called a Flat File because it stores data in a flat table layout.
Q3
If a specific field in a CSV file contains a comma as part of its actual data, how should that field be formatted?
- A. Enclosed in single quotes
- B. Enclosed in double-quotesCorrect
- C. Preceded by a backslash
- D. Separated by semicolons
Explanation. Fields containing commas are enclosed in double-quotes so they are not treated as delimiters.
Q4
When field data in a CSV file contains double-quotes as part of its actual value, how is it represented under standard formatting rules?
- A. Enclosed in single quotes
- B. Doubled, and the entire field is enclosed in double-quotesCorrect
- C. Replaced with single quotes
- D. Preceded by a slash symbol
Explanation. Internal double-quotes are doubled, and the whole field is wrapped in double-quotes.
Q5
Which Python module provides the built-in library functions to parse and process CSV files?
- A. sys
- B. os
- C. csvCorrect
- D. excel
Explanation. Python includes a native csv module specifically designed to handle CSV operations.
Q6
What is the default file opening mode when using the built-in open() function in Python?
- A. 'w'
- B. 'a'
- C. 'rt'Correct
- D. 'rb'
Explanation. The default mode of open() is 'r' or 'rt', which opens the file for reading in text mode.
Q7
Which block statement is recommended to open files in Python to ensure they are automatically closed even if an exception occurs?
- A. withCorrect
- B. open
- C. try...except
- D. import
Explanation. The with statement acts as a context manager and safely closes files automatically.
Q8
Which method of the csv.writer class is used to write a single row of data into a CSV file?
- A. writerow()Correct
- B. writerows()
- C. write()
- D. writeline()
Explanation. The writerow() method writes one row of data, while writerows() is used for multiple rows.
Q9
Which class of the Python csv module reads a CSV file and maps its data rows to dictionaries instead of lists?
- A. csv.reader
- B. csv.DictReaderCorrect
- C. csv.DictWriter
- D. csv.writer
Explanation. The csv.DictReader class reads CSV rows and maps the column values to dictionary keys.
Q10
What subclass of dictionary does the csv.DictReader class return by default for each row it iterates over in Python?
- A. list
- B. tuple
- C. OrderedDictCorrect
- D. set
Explanation. By default, csv.DictReader returns each row as an OrderedDict to keep field insertion order.
Q11
How can the default OrderedDict returned by csv.DictReader be converted into a standard Python dictionary?
- A. Using the list() function
- B. Using the dict() functionCorrect
- C. Using the tuple() function
- D. Using the set() function
Explanation. Applying the dict() type constructor to the OrderedDict converts it to a standard dictionary.
Q12
Which formatting parameter of csv.register_dialect() is set to True to remove whitespaces immediately following a delimiter?
- A. skipinitialspaceCorrect
- B. quoting
- C. escapechar
- D. doublequote
Explanation. The skipinitialspace parameter deletes initial whitespace right after the delimiter when set to True.
Q13
Which built-in Python function can be used to skip the header row of a CSV file before sorting or processing its data rows?
- A. skip()
- B. next()Correct
- C. pop()
- D. advance()
Explanation. The next() function fetches the first row of the reader iterator, skipping it for subsequent loops.
Q14
To sort a CSV file based on multiple columns, which operator function is passed as a key in the sorted() function?
- A. operator.sortby()
- B. operator.itemgetter()Correct
- C. operator.getter()
- D. operator.field()
Explanation. The operator.itemgetter() function allows specifying multiple column indices for sorting.
Q15
Which of the following line terminators are accepted by Python's CSV module for terminating rows?
- A. Only \n
- B. Only \r\n
- C. \r\n, \n, or \rCorrect
- D. Any custom string including tab characters
Explanation. The csv module of Python only accepts carriage return and line feed, line feed, or carriage return.
About these Python and CSV files questions
These are the Additional multiple-choice questions for Python and CSV files from the Tamil Nadu State Board (Samacheer Kalvi) 12th Standard Computer Science syllabus. Each question shows the correct option and an original, step-by-step explanation so you understand the method, not just the answer. Use the answer key above to jump to any question, then take the practice test to check yourself under exam-like conditions.
Frequently asked questions
How many MCQs are there in Python and CSV files?
This chapter has 15 book-back multiple-choice questions, each with the correct answer and a step-by-step explanation.
Are these 12th Standard Computer Science MCQs free to practise online?
Yes. Every question, answer and explanation here is free, and you can also take them as a timed practice test.
Where can I find the Python and CSV files book-back answers?
The correct option for each question is highlighted on this page with a worked explanation, plus a quick answer-key summary at the top.