You've been a huge help! I just have one last question.
import pathlib name = input('Enter a name: ') path = pathlib.Path("./Names") for entry in path.iterdir(): if entry.is_file(): with open(entry,'r') as f: for line in f: if name in line: name_count = line.count(name) print(name_count)this program is printing a 1 for every occurrence of 'name'. What I want is to print the total number of occurrences 'name' has throughout all the files. What am I missing?