CBSE Class 12 Computer Science Question 1 of 145

File Handling — Question 1

Back to all questions
1
Question

Question 1

Assertion. Python is said to have broadly two types of files - binary and text files, even when there are CSV and TSV files also.

Reason. The CSV and TSV are types of delimited text files only where the delimiters are comma and tab respectively.

Answer

(a)

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

Explanation

Python categorize files broadly into two types: binary files and text files.

  1. Binary files — These files store the information in the form of a stream of bytes.
  2. Text files — These files store the information in the form of a stream of ASCII or Unicode characters.
    Text files include CSV (Comma-Separated Values) and TSV (Tab-Separated Values) files because they contain human-readable text data and are specific types of delimited text files. In CSV files, fields are separated by commas, while in TSV files, fields are separated by tabs.