Send As SMS

4/17/2006

create a double dictionary in python

to create a double dictionary in python, the following won't work:

>>> x = dict()
>>> x[1][1] = "foo"
instead, you need only one set of brackets:
>>> x = dict()
>>> x = [1,1] = "foo"


0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home

My blog has moved! Redirecting...

You should be automatically redirected. If not, visit http://stinkpot.afraid.org:8080/tricks/ and update your bookmarks.