Question: Python 3. Implement a recursive function fileContents () that takes as parameters the name of a folder. The function will return a string representing the

 Python 3. Implement a recursive function fileContents () that takes as

Python

3. Implement a recursive function fileContents () that takes as parameters the name of a folder. The function will return a string representing the contents of all the files in the directory hierarchy. Please note that your function must work as described on any directory structure, not just the one provided as an example. You must use recursion to go through the subfolders. You may not use python crawlers or apis other than the ones used in the antivirus-redux example to find files in sub directories. Doing so will be an automatic O for this problem. You may use a for loop to loop through the contents of a folder. The following illustrates a sample set of folders and directories located in the zip file containing the exam template. You don't need to worry about punctuation, case or file error handling for this problem. >>> fileContents('Test') 'I hope you like this assignment. Looking forward to Spring break! This is a test. Zoko assignment. Looking forward to Spring br eak! Looking forward to Spring break!I hope you like this assignment. This is a test. Zoko assignment. I hope you like this assi gnment. Looking forward to Spring break! This is a test. Zoko assignment. 3. Implement a recursive function fileContents () that takes as parameters the name of a folder. The function will return a string representing the contents of all the files in the directory hierarchy. Please note that your function must work as described on any directory structure, not just the one provided as an example. You must use recursion to go through the subfolders. You may not use python crawlers or apis other than the ones used in the antivirus-redux example to find files in sub directories. Doing so will be an automatic O for this problem. You may use a for loop to loop through the contents of a folder. The following illustrates a sample set of folders and directories located in the zip file containing the exam template. You don't need to worry about punctuation, case or file error handling for this problem. >>> fileContents('Test') 'I hope you like this assignment. Looking forward to Spring break! This is a test. Zoko assignment. Looking forward to Spring br eak! Looking forward to Spring break!I hope you like this assignment. This is a test. Zoko assignment. I hope you like this assi gnment. Looking forward to Spring break! This is a test. Zoko assignment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!