We use Python 3.6

go back Level: Intermediate (img: IM / score: 3) level Bite 116. List and filter files in a directory

15 out of 15 users completed this Bite ...
Will you be Pythonista #16 to crack this Bite?
Average Bite difficulty 1-10 rating: 5.0
» Up for a challenge? 💪

In this Bite you complete get_files that receives a dirname and size_in_kb.

There are two things you need to code:

  1. Inspect/list the files in dirname,
  2. Filter out the files that are bigger or equal than size_in_kb, return those in a list (or turn the function into a generator.

The os module is your friend here, but you also might want to check out glob. Have fun and keep coding in Python!

Github login button