To clarify, you can do the above in one line as well. The difference between `.setdefault` and `.get` is that the latter just returns a value and the former sets the default value if it doesn't already exist in the dict.

So this could also be written as a one-liner:

```
locations.setdefault(w, []).append(i)
```