How can I read a dictionary with a list?
<p>How can I read a list inside a dictionary and try to change string numbers to digits? For example:</p>

<pre><code>obj = {'azul':'4','rojo':[{'rojo_a':'1','rojo_b':'2'}],'amarillo':'xxx','naranja':[{'naranja_1':'1','naranja_2':'2'}]}
</code></pre>

<p>I use this to change dictionary number strings to integers:</p>

<pre><code>{k:int(v) if v.isdigit() else v for k,v in obj.items()}
</code></pre>

<p>But it doesn't work, so I was trying something like this:</p>

<pre><code>for objs in obj:
if objs.isdigit():
    k:int(v)
else:
    for k,v in objs.items():
        print k
</code></pre>

<p>But this fails as well.</p>