def generateItemCounts(skus):
    itemCounts = collections.defaultdict(int)
    for item in skus:
        invalidItem = (item not in string.ascii_uppercase)
        if invalidItem:
            raise ValueError
        else:
            itemCounts[item] += 1
    return itemCounts
def generateItemCounts(skus):
    itemCounts = collections.defaultdict(int)
    for item in skus:
        invalidItem = (item not in string.ascii_uppercase)
        if invalidItem:
            raise ValueError
        else:
            itemCounts[item] += 1
    return itemCounts