Also, in python 2.7, you can use `{c.id: c for c in courses}` to create a dictionary.