Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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: 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

2. Provide recommendations for effective on-the-job training.

Answered: 1 week ago