How to flatten nested python dictionaries?
<p>I'm trying to flatten the nested dictionary:</p>

<pre><code>dict1 = {
    'Bob': {
        'shepherd': [4, 6, 3],
        'collie': [23, 3, 45],
        'poodle': [2, 0, 6],
    },
    'Sarah': {
        'shepherd': [1, 2, 3],
        'collie': [3, 31, 4],
        'poodle': [21, 5, 6],
    },
    'Ann': {
        'shepherd': [4, 6, 3],
        'collie': [23, 3, 45],
        'poodle': [2, 10, 8],
    }
}
</code></pre>

<p>I'd like to display all values in lists:
[4, 6, 3, 23, 3, 45, 2, 0, 6, 1, 2, 3,..., 2, 10, 8]</p>

<p>My first idea was to do in this way:</p>

<pre><code>dict_flatted = [ i for name in names.values() for dog in dogs.values() for i in dog]
</code></pre>

<p>Though I'm getting the error. I'd be happy for tips how to handle it.</p>