I have been set a challenge to browse a directory that contains mostly empty folders - the flag(answer) is in one of them. I have used os module to see all the names of the folders - they are all named 'folder-' plus a number between 1 and 200. How do I view what is inside them?
You should use os.walk() instead of litdir() like as
import os
import os.path
for dirpath, dirnames, filenames in os.walk("."):
for file in filenames:
print(file)