Skip to content

Instantly share code, notes, and snippets.

@serashioda
Created February 7, 2017 20:03
Show Gist options
  • Save serashioda/364d6c86c3c117f413bbce6661199e55 to your computer and use it in GitHub Desktop.
Save serashioda/364d6c86c3c117f413bbce6661199e55 to your computer and use it in GitHub Desktop.
Find the Path
def find_path():
```Write a function that takes a file path as the first argument, and a file extension as an optional second argument.
If the file extension is not None, then traverse the given file path looking for all instances of files with that extension.
SO…
If extension = ".py" and filepath = "/home/Nick/"
Return the absolute path to every file ending in that extension
/home/Nick/foo.py
/home/Nick/django_stuff/manage.py
/home/Nick/django_stuff/blog/models.py
If extension IS none, then return all file paths in subtrees
Submit the link to your gist to my email (nicholas@codefellows.com) by 12:30 pm
```
If it would help, you can use any data structure you’ve written thus far
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment