Skip to content
Question 20 of 22

Q.Q. 17 and 18 are ASSERTION (A) and REASONING (R) based questions. Mark the correct choice as (A) Both (A) and (R) are true and (R) is the correct explanation for (A) (B) Both (A) and (R) are true and (R) is not the correct explanation for (A) (C) (A) is true but (R) is false (D) (A) is false but (R) is true Assertion (A): CSV file is a human readable text file where each line has a number of fields, separated by comma or some other delimiter. Reason (R): writerow() method is used to write a single row in a CSV file.

Uttarakhand UbseCBSE Class XII Board 2024MCQ· 1mImportance★★★★★
91% · 20/22 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

CSV files are indeed human-readable text with delimited fields, and writerow() does write a single row; both statements are true but the reason doesn't explain the assertion's definition of CSV structure.

The question tests two independent facts about CSV files in Python: what a CSV file is (its structure and readability) and what a specific method does (writing rows). To choose correctly, we need to verify each statement separately and then check whether the reason logically explains the assertion.

Understanding the Assertion

A CSV (Comma-Separated Values) file is fundamentally a plain-text format. You can open it in any text editor—Notepad, VS Code, vim—and read its contents directly. Each line represents a record, and within each line, fields are separated by a delimiter (most commonly a comma, but sometimes a tab, semicolon, or pipe). For example:

Name,Age,City
Alice,25,Mumbai
Bob,30,Delhi

This is human-readable: no binary encoding, no proprietary format. The assertion accurately describes this structure.

Understanding the Reason

Python's csv module provides a writer object with a writerow() method. When you call writerow(row_data), it writes exactly one row to the CSV file, automatically handling the delimiter and any necessary quoting. For instance:

import csv
with open('data.csv', 'w', newline='') as f:
    writer = csv.writer(f)
    writer.writerow(['Name', 'Age', 'City'])

This writes a single row (the header) to the file. The reason is factually correct.

The Logical Connection

Now the critical question: does the reason explain the assertion? …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.