I want to write a python script using which I can recover files from a formatted drive. I know formatting …