In this quiz, you’ll test your understanding of How to Get a List of All Files in a Directory With Python.
By working through this quiz, you’ll revisit how .iterdir() hands you the contents of a single directory, how glob patterns let .glob() and .rglob() filter results by name, and how .rglob() walks an entire directory tree.
You’ll also check your understanding of filtering on attributes with comprehensions and filter(), and of skipping junk directories instead of listing every file inside them.
[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]
