Computer Science

Differentiate between text file and binary file.

Python File Handling

8 Likes

Answer

Text FileBinary File
A text file consists of human readable characters, which can be opened by any text editor.A binary file is made up of non-human readable characters and symbols, which require specific programs to access its contents.
A text file is a file that stores information in the form of a stream of ASCII or Unicode characters.A binary file is a file that stores the information in the form of a stream of bytes.
In text files, each line of text is terminated with a special character known as EOL (End of Line) character.In a binary file, there is no delimiter for a line and no character translations occur here.
Files with extensions like .txt, .py, .csv etc are some examples of text files.Files with extensions like .jpg, .pdf etc are some examples of binary files.

Answered By

6 Likes


Related Questions