python calculate how many files are there in a directory structure code example Example: python count files directory import os len(os.listdir(directory))