Sumedha Mehta
1 min readJun 16, 2017

--

Hey Mike,

The whole point of nested dictionaries is that you can store several choices for a certain category, and you can do that at three levels in this case: the make, which has many models. And then each model has many years associated with it.

An example in Python(don’t remember swift very much) looks like this:

Make = dict()

For each make…

newModel = dict()

Years = []

Model[‘camry’] = [‘2000', ‘2001', …]

Make[‘toyota’] = newModel

Let me know if it’s still confusing. Obviously you have to find a proper way to populate your data.

--

--

Sumedha Mehta
Sumedha Mehta

Written by Sumedha Mehta

I like writing about StackOverflow answers I can’t find and other thoughts // product @ mongodb (realm)

No responses yet