wordList = [ "Hello", "World", "how", "are", "you" ]
for word in wordList:
    print(word + "!")

print("---")

d = {'a': 4, 'b': 7, 'c': 18, 'e': 42}
for k in d: # 'a', 'b', 'c', 'e'
    print("Key:", k)
    print("Value:", d[k])

print("---")
    
"""
You do: write the function printItems(foodCounts) that takes a
dictionary mapping foods (strings) to counts (integers), loops
over the key-value pairs, and print the number of each individual
food type included in the input.

For example, if d = { "apples" : 5, "beets" : 2, "lemons" : 1 },
the function might print
5 apples
2 beets
1 lemons
"""

def printItems(foodCounts):
    for k in foodCounts:
        print(foodCounts[k], k)
    
d = { "apples" : 5, "beets" : 2, "lemons" : 1 }
printItems(d)
    
print("---")

def countItems(itemDict):
    total = 0
    for item in itemDict:
        total = total + itemDict[item]
    return total

print(countItems(d))

print("---")

def makeAlphabetDict(wordList):
    d = { }
    for i in range(len(wordList)):
        word = wordList[i]
        firstLetter = word[0]
        listOfWords = [word]
        if firstLetter in d:
            d[firstLetter] = d[firstLetter] + [word]
            #d[firstLetter].append(word)
        else:
            d[firstLetter] = [word]
    return d

lst = [ "it", "is", "apparently", "awesome", "to", "see", "you", "all", "here", "today" ]
print(makeAlphabetDict(lst))