Class - 12 CBSE Computer Science — Assertion Reason Type Questions
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.
Python File Handling
2 Likes
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.
- Binary files — These files store the information in the form of a stream of bytes.
- 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.
Answered By
2 Likes