[Solved] Print from List Python


a bit unclear, are you looking for this?

In [41]: a = [{ 'a':'z', 'b':'x', 'c':'w', 'd':'v'}, { 'a':'f', 'b':'g', 'c':'h', 'd':'i'}]

In [42]: a[0].get('a')
Out[42]: 'z'

…or this?

In [50]: a[0].values()
Out[50]: ['z', 'w', 'x', 'v']

…or using your provided data:

In [47]: data = {'style': '-', 'subCat': '-', 'name': 'Eurodollar Futures', 'oi': '9,774,883', 'floor': 'ED', 'url': '/trading/interest-rates/stir/eurodollar_contract_specifications.html', 'clearing': 'ED', 'cpc': 'ED', 'venues': 'Globex Floor ClearPort ', 'cat': '-', 'vol': '2,026,353', 'globex': 'GE', 'group': 'Interest Rate', 'tags': '-', 'cleared': 'Futures', 'id': 1, 'exch': 'CME', 'subGroup': 'Stirs'}

In [48]: data.get('name')
Out[48]: 'Eurodollar Futures'

you can also loop over the dictionary:

In [52]: for k,v in a[0].iteritems():
   ....:     print k, v
   ....:     
a z
c w
b x
d v

3

solved Print from List Python