python' os module to provide python implementation of recursive algorithm for computing disk usagewe rely on python' os modulewhich provides robust tools for interacting with the operating system during the execution of program this is an extensive librarybut we will only need the following four functionsos path getsize(pathreturn the immediate disk usage (measured in bytesfor the file or directory that is identified by the string path ( /user/rt/coursesos path isdir(pathreturn true if entry designated by string path is directoryfalse otherwise os listdir(pathreturn list of strings that are the names of all entries within directory designated by string path in our sample file systemif the parameter is /user/rt/coursesthis returns the list cs cs os path join(pathfilenamecompose the path string and filename string using an appropriate operating system separator between the two ( the character for unix/linux systemand the character for windowsreturn the string that represents the full path to the file python implementation with use of the os modulewe now convert the algorithm from code fragment into the python implementation of code fragment import os def disk usage(path) """return the number of bytes used by file/folder and any descendents "" total os path getsize(pathaccount for direct usage if os path isdir(path)if this is directory for filename in os listdir(path)then for each child childpath os path join(pathfilenamecompose full path to child add child' usage to total total +disk usage(childpath descriptive output (optional print { :< format(total)path return total return the grand total code fragment recursive function for reporting disk usage of file system