We open one file called quote. txt in read mode. We read each line from the input file and write it into the output file and close the files.
'w' – open a file for writing. The pointer is placed at the beginning of the file and this will overwrite any existing file with the same name. If the file doesn't exist, the open() function creates a new file.