Question: 1. 2. Write the recursive function get files list, which takes a valid Path object representing a path to some directory/folder on a computer. The

1.

1. 2. Write the recursive function get files list, which takes a

2.

valid Path object representing a path to some directory/folder on a computer.

Write the recursive function get files list, which takes a valid Path object representing a path to some directory/folder on a computer. The function should return a list of Path objects for all paths that are files (and not folders). The given path is guaranteed to exist, so you do not need to validate it in your solution. You are required to use the pathlib library appropriately in your solution some potentially useful information is below. Assume Path is imported from pathlib. Path.is_dir(self) Path.iterdir(self) Returns if a Path is a directory Allows iteration through subdirectories of a Path The Path constructor takes in a string representing a path. def get_files_list (path: Path) [Path]

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!