"spohle" <[EMAIL PROTECTED]> writes: > dic = {'key1':'value1', 'key2':'value2', 'key3':'value3'} > > list = [key2, key3, key1]
Is this what you want? dic = {'key1':'value1', 'key2':'value2', 'key3':'value3'} keys = ['key2', 'key3', 'key1'] items = [dic[k] for k in keys] print items -- http://mail.python.org/mailman/listinfo/python-list