File Representation

In this lesson you will learn about file representation in Python.

What is a file?

A file is a collection of related information that is recorded on secondary storage devices like magnetic disks, hard disks, and tapes. It acts as a medium for giving input and receiving output from a program. There are multiple file formats that you must have used on your computer, ranging from text files to video files. Some of the most common file formats are shown in Figure 1.

Figure 1. Computer files with different formats.
Figure 1. Computer files with different formats.

In secondary ...