I need to make function, which will return for a given folder, a Dictionary, which describes its content. Keys let be the names of the subfolders and files, key value repres
def f(path):
if os.path.isdir(path):
d = {}
for name in os.listdir(path):
d[name] = f(os.path.join(path, name))
else:
d = os.path.getsize(path)
return d