how to make python know number of files in adirectory code example Example: python count files directory import os len(os.listdir(directory))