Digital Academic Solutions

CSC 242 Daily Exercise 3 Python Recursive filePrint()

SOLUTION AVAILABLE AT: http://libraay.com/downloads/csc-242-daily-exercise-3-python-recursive-fileprint/

Problem:

Write a recursive function filePrint() that takes as parameters a pathname of a folder as a string and an integer indent and prints to the screen the pathname of every file contained in the folder, directly or indirectly.  The file path names should be output with an indentation that is proportional to their depth with respect to the topmost folder and should use the parameter indent to achieve this.  You are allowed to use a loop in this function, but the main work of the function should be done using recursion.

SOLUTION AVAILABLE AT: http://libraay.com/downloads/csc-242-daily-exercise-3-python-recursive-fileprint/

Leave a Reply

Your email address will not be published. Required fields are marked *



Solutions Authored by 15+ Years Experienced Industry Expert