Computer Science
Write the advantages of saving data in:
(a) Binary form
(b) Text form
Python Data Handling
3 Likes
Answer
(a) The advantages of saving data in binary form are as follows:
- Efficiency — Binary files store data in a compact binary format, which can lead to smaller file sizes compared to text-based formats. Binary form is efficient for storing raw binary data.
- Speed — Reading and writing binary data can be faster than text-based formats because there is no need for encoding or decoding operations.
- Data Integrity — Binary files preserve the exact binary representation of data without any loss of information.
(b) The advantages of saving data in text form are as follows:
- Human Readability — Text-based formats, such as plain text files, are human-readable, making them easy to inspect and edit using a text editor.
- Interoperability — Text files can be easily shared and processed across different platforms and programming languages.
- Compatibility — Text-based formats are widely supported by various software applications and systems, making them a versatile choice for data interchange and communication.
Answered By
3 Likes
Related Questions
Write a code snippet that will create an object called fileout for writing; associate it with the filename 'STRS'. The code should keep on writing strings to it as long as the user wants.
How many file objects would you need to create to manage the following situations ? Explain.
(i) to process three files sequentially
(ii) to merge two sorted files into a third file.
Why is it required to close a file after performing the reading and writing operations on a file?
When do you think text files should be preferred over binary files ?