On 22-12-2009 22:33, mattia wrote:
Is there a function to initialize a dictionary?
Right now I'm using:
d = {x+1:[] for x in range(50)}
Is there any better solution?

Maybe you can use:
        dict.fromkeys(xrange(1,51))
but this will initialize all values to None instead of an empty list...

-irmen




--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to