количество подкаталогов
import os
sum(os.path.isdir(os.path.join(path,i)) for i in os.listdir(path))
Real Raccoon
import os
sum(os.path.isdir(os.path.join(path,i)) for i in os.listdir(path))