def func(letters, words):
dict = {}
for letter in letters:
dict[letter] = [s for s in words if s[0] == letter]
return dict
letters = ['a', 'n']
words = ['hello', 'human', 'home', 'all', 'art', 'august', 'napkin', 'potato']
dict = func(letters, words)
print(dict)
def func(letters, words):
dict = {}
for letter in letters:
dict[letter] = [s for s in words if s[0] == letter]
return dict
letters = ['a', 'n']
words = ['hello', 'human', 'home', 'all', 'art', 'august', 'napkin', 'potato']
dict = func(letters, words)
print(dict)