1. def capital_count(filename): f = open(filename, "r") count = 0 for line in f: if line[0].isupper(): count +=1 f.close() return count 2. def dict_value_count(d, value): count = 0 for k in d: if d[k] == value: count += 1 return count 3. letter_count = {"d":1, "a":1, "v":1, "e":1} We can declare a dictionary in the same way that it's printed out, i.e. a comma separated list of key:value pairs inside curly braces.