File: A file is a collection of data stored in an enclosed unit( the data can be text, image etc.), identified by a filename. File Handling: File handling is the process of applying various operations on the file such as create , update , delete etc. File Handling in python…