Computer Science
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.
Python File Handling
1 Like
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.
Answered By
1 Like
Related Questions
The csv files are text files.
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.
Assertion. The file modes "r", "w", "a" also reveal the type of file these are being used with.
Reason. The binary file modes have 'b' suffix with regular file modes.
Assertion. 'Pickling' is the process whereby a Python object hierarchy is converted into a byte-stream.
Reason. A binary file works with byte-streams.