Getting a list value from key/value pair

Kayode Odeyemi dreyemi at
Sun Sep 18 11:39:03 CEST 2011

Hi all,

If I have a list with key/value pair, how do I get the value of the key?

I'm working with this code snippet:

>>> items = {'fees':[('status','pending'), ('timeout',60)],
 'pending'), ('timeout','120')]}
>>> print [items[i] for i in items.keys()]
[[('status', 'pending'), ('timeout', '120')], [('status', 'pending'),
, 60)]]

Odeyemi 'Kayode O. t: @charyorde
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list