Implement the recursive function getFilesGivenCount (pathname,…
Question Answered step-by-step Implement the recursive function getFilesGivenCount (pathname,… Implement the recursive function getFilesGivenCount (pathname, count) that takes as parameters a directory name and a value n. The function should search the directory and all subdirectories recursively for files, open each file found, and see if the total length of the content of the file is equal to or greater than n. If it is equal to or greater than n, the function will add the full path (directories + filename) into a list and return that list. PLEASE USE PYTHONpathname: a string representing the main directorycount: numerical value that will be used to check the content length of the fileHint: You will run into repeated filenames, that is fine for this problem, as the files will exist multiple times at different directories, double check the larger values of n to make sure the directories are matching the same. Feel free to create .txt files for testing on even larger numbers. Start code with the following:def getFilesGivenCount(pathname, count): pass Image transcription text>>>getFilesGivenCount ( ‘Test’ , 30) ‘Test\file2. txt’, ‘Test\file3. txt’, ‘Test\Test1 Test1-A\filel. txt’,’Test\Test1\Test1-B\Test1-B-B\file3. txt’, ‘Test\Test1\Test1-C\C3 \file3. txt’,’Test\Test2\B\B1-1\B2-2\B\B\file2. txt’, ‘Test\Test3\A\B\file2. txt’, ‘Test\Test3\A\file3. … Show more… Show more Computer Science Engineering & Technology Python Programming CSC 242 Share QuestionEmailCopy link Comments (0)


