[Tutor] Addind items to dictionaries
Bernard Lebel
python at bernardlebel.com
Mon Oct 4 15:23:30 CEST 2004
Thanks a lot!
Bernard
----- Original Message -----
From: "Max Noel" <maxnoel_fr at yahoo.fr>
To: "Bernard Lebel" <python at bernardlebel.com>
Cc: <tutor at python.org>
Sent: Monday, October 04, 2004 3:11 PM
Subject: Re: [Tutor] Addind items to dictionaries
>
> On Oct 4, 2004, at 14:02, Bernard Lebel wrote:
>
> > Hello,
> >
> > Sorry for the basic question, but I can't seem to be able to retrieve
> > it in the documentation... how
> > do you add an item (key + value) to an existing dictionary?
> >
> >
> > oModelPathDictionary = {}
> > oModelPathDictionary.append( 'myKey': 'myKeyValue' )
> >
> > I always get errors when doing this.
>
> Just use oModelPathDictionary['myKey'] = 'myKeyValue'
>
> -- Wild_Cat
> 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