Print Value of Key in Lists of Dicts in Python
<p>I am trying to print the value of a specific key in a list of dicts:</p>

<p>eg:</p>

<pre><code>list = [{'a' : 123, 'b': 'xyz', 'c': [1,2]}, {'a' : 456, 'b': 'cde', 'c': [3,4]}] 
</code></pre>

<p>I was hoping to be able to print the following for each dict:</p>

<pre><code>print ("a: ", a)
print ("b: ", b)
</code></pre>

<pre><code>lst = [{'a' : 123, 'b': 'xyz', 'c': [1,2]}, {'a' : 456, 'b': 'cde', 'c': [3,4]}]
output=['a','b']
for dct in lst:
    for k in output:
        print(k+': '+str(dct[k]))
</code></pre>

python dictionary