Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help with Python problem: Write a recursive function f ilePrint () that takes as parameters a pathname of a folder as a string and
Need help with Python 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.
Python 3.4.1 Shell File Edit Shell Debug Options Windows Help file Print test 0) test file A.txt test folder 1 file .txt test folder 1 filec txt test folder 1 folder 11 file D .txt test folder 21 fileD. txt test folder2 fileE .txt file Print test 5) test file A txt test folder 11 file B. txt test folder 11 filec .txt test folder 1 folder 111 fileD .txt test folder 21 fileD. txt test folder2 fileE .txt file Print test path 2) test path directoryA directoryA1ltestfileA1. txt test path directoryA directoryA2 testfileA2. txt test path directory directoryB2Atestfile2. py test path test file1. py file Print empty 0) Ln: 66 Col: 4Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started