CBSE Class 12 Computer Science Question 2 of 145

File Handling — Question 2

Back to all questions
2
Question

Question 2

Assertion. The file modes "r", "w", "a" work with text files, CSV files and TSV files alike.

Reason. The CSV and TSV are types of delimited text files only.

Answer

(a)

Both Assertion and Reason are true and Reason is the correct explanation of Assertion.

Explanation

The file modes "r", "w", and "a" are used to specify the type of operations that can be performed on files in Python. These modes are commonly used with text files, CSV files, and TSV files alike because all of these file types contain human-readable text data. CSV (Comma-Separated Values) and TSV (Tab-Separated Values) are types of delimited text files.