In order to read and write into a file, we will use the open() built-in function to open the file. The open() function creates an file_object object. What is an object? You will understand in Chapter 11, Class and Objects. The Syntax is given as:
file_object = open(file_name ,access_mode)
The first argument,file_name, specifies the filename that you want to open. The second argument, access_mode, determines in which mode the file has to be opened, that is, read, write, append, and so on.