import os dir_to_count = "." print(f"There are {len(os.listdir(dir_to_count))} files in the directory.")