Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Docs needed: (Python) https://drive.google.com/drive/folders/14k519s5mOf_lM8XFRnbEaiJ4YlFanPAF?usp=sharing https://drive.google.com/file/d/1LO93VIEeKmtM5UxNKvHuyIOLxw3vKm5h/view?usp=sharing Write a recursive function traverseO that takes as parameters a pathname of a folder as a string and an integer

image text in transcribed

Docs needed: (Python)

https://drive.google.com/drive/folders/14k519s5mOf_lM8XFRnbEaiJ4YlFanPAF?usp=sharing

https://drive.google.com/file/d/1LO93VIEeKmtM5UxNKvHuyIOLxw3vKm5h/view?usp=sharing

Write a recursive function traverseO that takes as parameters a pathname of a folder as a string and an integer indent and prints to the screen the pathname cf every file and subfolder contained in the folder directly or indirectly. The file and subfolder path names should be output with an indentation that is prcpcrtional to their depth with respect to the topmost folder and should use the parameter indent to achieve this. The example below illustrates the execution of the function on several sample folders. All of the sets of folders and files can be found in the zip file containing the template and posted to D2L 2. >>>traverse('Test',5 Test TestlFile.txt.txt TestlTestl Test Testl\File.txt.txt Test Testl\Iestl-A Test Testl\Testl-AFile.txt.txt Test Testl\Test1-A\Testl-A-A Test\Test1\Testi-Ai Test 1-A-A\Ai File. txtIXt Test TestllTestl-AlTestl-A-A\File,txt.txt TestlTestl\Iestl-B Test Testl\Testl-B\Testl-B-A Test TestllTestl-B\Testl-B-AB3 Test Testl\Testi-B\Testl-B-E Test Testl\Testl-ciC Test\ Test1\Test1-3\Test 1-B-A\B3?B: Test Testl\Iestl-c Test\Testl\Testi-ciC2 Test TestllTestl-ciC2 C31 Test\Testl\Testl-ciC2 C31\A Test ? Test1 \ Test1-Cl C2 \C31 \AiA Testi Testi Testi-CIC2\C31 ?A IA IA Test Testl\Testi-clC2\C31 AAAA Test TestllTestl-cic21C32 Test\Iestl\Testl-cicz\C32\File.txt.txt Test\Testl Testl-ciC3 Test Test2 TestlTest3

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

Students also viewed these Databases questions