CBSE Class 12 Computer Science Question 41 of 145

File Handling — Question 2

Back to all questions
2
Question

Question 2

Which of the following format of files can be created programmatically through Python to store some data ?

  1. Data files
  2. Text files
  3. Video files
  4. Binary files
Answer

Text files, Binary files

Reason

  1. Text files — Text files are one of the most common formats for storing data. They contain human-readable text and can be created and manipulated using Python's built-in file handling functions like open(), write() etc.

  2. Binary files — Binary files store data in a binary format, which means they contain sequences of bytes that may represent any type of data, including text, images, audio, or any other type of information. Python provides facilities for working with binary files through modes like 'rb' (read binary) and 'wb' (write binary).