Question: I'm working through a python workbook, and I have to turn the following dictionary into a list:

```
lexicon = {
    'north': 'direction',
    'south': 'direction',
    'east': 'direction',
    'west': 'direction',
    'down': 'direction',
    'up': 'direction',
    'left': 'direction',
    'right': 'direction',
    'back': 'direction',
    'go': 'verb',
    'stop': 'verb',
    'kill': 'verb',
    'eat': 'verb',
    'the': 'stop',
    'in': 'stop',
    'of': 'stop',
    'from': 'stop',
    'at': 'stop',
    'it': 'stop',
    'door': 'noun',
    'bear': 'noun',
    'princess': 'noun',
    'cabinet': 'noun'}

```

But I can't find anything on the internet that's helped me do so. How would I go about turning this into a list? Help is appreciated!

Answer: 
You can use `.keys()` or `.values()`.

```
>>> list(lexicon.keys())
['princess', 'down', 'east', 'north', 'cabinet', 'at', 'right', 'door', 'left', 'up', 'from', 'bear', 'of', 'the', 'south', 'in', 'kill', 'eat', 'back', 'west', 'it', 'go', 'stop']
>>> list(lexicon.values())
['noun', 'direction', 'direction', 'direction', 'noun', 'stop', 'direction', 'noun', 'direction', 'direction', 'stop', 'noun', 'stop', 'stop', 'direction', 'stop', 'verb', 'verb', 'direction', 'direction', 'stop', 'verb', 'verb']

```

You could use `.items()` to get the key,value pairs as a list of tuples

```
>>> list(lexicon.items())
[('princess', 'noun'), ('down', 'direction'), ('east', 'direction'), ('north', 'direction'), ('cabinet', 'noun'), ('at', 'stop'), ('right', 'direction'), ('door', 'noun'), ('left', 'direction'), ('up', 'direction'), ('from', 'stop'), ('bear', 'noun'), ('of', 'stop'), ('the', 'stop'), ('south', 'direction'), ('in', 'stop'), ('kill', 'verb'), ('eat', 'verb'), ('back', 'direction'), ('west', 'direction'), ('it', 'stop'), ('go', 'verb'), ('stop', 'verb')]

```
if you just want values you can use :
`lexicon.values()` it will return you the values saved against each key.

but if you want to have a list of key value pairs then you can use the following :

```
  >>lexicon.items()
  output : 
  [('right', 'direction'), ('it', 'stop'), ('down', 'direction'), ('kill', 'verb'), ('at', 'stop'), ('in', 'stop'), ('go', 'verb'), ('door', 'noun'), ('from', 'stop'), ('west', 'direction'), ('eat', 'verb'), ('east', 'direction'), ('north', 'direction'), ('stop', 'verb'), ('bear', 'noun'), ('back', 'direction'), ('cabinet', 'noun'), ('princess', 'noun'), ('of', 'stop'), ('up', 'direction'), ('the', 'stop'), ('south', 'direction'), ('left', 'direction')]

```

hope this helps