list to dict

Yermat loic at fejoz.net
Wed Jun 16 09:37:18 EDT 2004


Bart Nessux wrote:
> What is the easiest/fastest way to build a dictionary from a list? The 
> list contains 100,000 entries.
> 
> Thanks,
> Bart

 >>> dict([(1,'a'),(2,'b')])
{1: 'a', 2: 'b'}

list of tuples -> dict !

-- 
Yermat




More information about the Python-list mailing list