[Tutor] Dictionary Inserts...
Max Noel
maxnoel_fr at yahoo.fr
Thu May 5 17:52:12 CEST 2005
On May 5, 2005, at 16:37, Allen John Schmidt, Jr. wrote:
> Ok, I have had enough. I have looked all through the python docs and I
> cannot find it. How do you insert an entry into a dictionary?
>
The way you think it's done:
>>> a = {'foo': 1, 'bar': 2}
>>> a
{'foo': 1, 'bar': 2}
>>> a['baz'] = 'boo'
>>> a
{'baz': 'boo', 'foo': 1, 'bar': 2}
>>>
Interactive Python is your friend ^^.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge
a perfect, immortal machine?"
More information about the Tutor
mailing list