[Tutor] how to use
anil maran
anilmrn at yahoo.com
Sun Aug 6 08:54:34 CEST 2006
what does
x**x) do?
2nd) what is the key for the dictionary, i assume x is the value of the dictionary
John Fouhy <john at fouhy.net> wrote: On 05/08/06, anil maran 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.
_______________________________________________
Tutor maillist - Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor
---------------------------------
Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060805/ad385238/attachment.html
More information about the Tutor
mailing list