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 = {"a":3, "l":1, "e":1, "x":1, "n": 1, "d": 1, "r": 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.