[Tutor] how to use

John Fouhy john at fouhy.net
Sun Aug 6 01:22:32 CEST 2006


On 05/08/06, anil maran <anilmrn at yahoo.com> wrote:
> list comprehensions to return a dictionary

Well, hyou can use the dict function.  eg:

dict((x, x**x) for x in range(10))

-- 
John.


More information about the Tutor mailing list