Question: I am trying to loop through a list of split words to make a dictionary, using the first word as a key, and the proceeding word as a value (as in google's basic python exercises: <https://developers.google.com/edu/python/exercises/basic>).

I am getting the error message: "AttributeError: 'str' object has no attribute 'append'" with the code below:

```
def mimic_dict(filename):
"""Returns mimic dict mapping each word to list of words which follow it."""
mimic = {}
f = open(filename, 'r')
fulltext = f.read()
splittext = fulltext.split(' ')

for c in range(len(splittext)-1):
    if splittext[c] in mimic:

#Error on the next line
        mimic[splittext[c]].append(splittext[c+1])
    else:
        mimic[splittext[c]] = splittext[c+1]

```

I have been trying to use the method here: [Appending values to dictionary in Python](https://stackoverflow.com/questions/3419147/appending-values-to-dictionary-in-python)
but without success. I'm sure my error is simple, but i have spent seemingly ages on this. Any help would be appreciated!

Answer: 
`splittext[c]` is a string and you are trying to append to it (which, of course, fails).

Did you mean to say `mimic[splittext[c]] = [splittext[c+1]]` in your last line? Note the angular brackets, you need to add a `list` to the `mimic` dictionary in order to append more elements to it later.
You're trying to use `.append()` on `splittext[c]`, which is a the string contained at index `c` of the list `splittext`. You cannot use `.append()` on a string.