Question: ANSWER ASAP PLEASE IN PYTHON 1. Write a function searchForFolder(dir, keyfolder) that searches for a folder, `keyfolder` in the direcory given by `dir`. If the

ANSWER ASAP PLEASE IN PYTHON

1. Write a function

searchForFolder(dir, keyfolder) that searches for a folder, `keyfolder` in the direcory given by `dir`. If the folder is found, the string **path** for the folder is returned. This path can be either relative or absolute. If the name in `keyfolder` is not present, or if it is not a **directory**, the function should return `None` to so indicate. (Note that `None` is the Python "empty" type; it is not a string with those characters.)

2. Write a function

countFileMatch(dir, prefix) that searches the files in the give directory, `dir`, and determines the **count** of the number of files where the start of the file name matches `prefix`. It should not count any folders whose name might match. If no files in the directory match the prefix, the function should return 0. If the directory does not exist or the variable refers to something that is not a directory, the function should return `None`.

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!