I have an exercise to walk through all direcories in a subdirectory and check if there are empty or not. I already tried something but this don't work:
import os
path = input(">>> ")
for (root,dirs,files) in os.walk(path, topdown=True):
if len(dirs and files) == 0:
print(os.listdir(dirs)) == 0
print(root)
print(dirs)
print(files)
print('--------------------------------')
else:
print()
Can you help me with it?
Thanks