manga_names = {} with open('manga_list.txt', 'r') as file: manga = file.readline() file.readline() manga_names.setdefault(manga, 0) manga_names[manga] += 1