what does
 x**x) do?

2nd) what is the key for the dictionary, i assume x is the value of the dictionary


John Fouhy <[EMAIL PROTECTED]> wrote:
On 05/08/06, anil maran <[EMAIL PROTECTED]> 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 - [email protected]
http://mail.python.org/mailman/listinfo/tutor


Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups.
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to