append to the end of a dictionary

jay graves jaywgraves at gmail.com
Tue Jan 24 09:50:13 EST 2006


Yves Glodt wrote:
> I seem to be unable to find a way to appends more keys/values to the end
> of a dictionary... how can I do that?

A dictionary doesn't have an 'end' because it is an unordered
collection.

> E.g:
> mydict = {'a':'1'}
> I need to append 'b':'2' to it to have:

mydict['b'] = '2'
print mydict

http://python.org/doc/2.4.2/tut/node7.html#SECTION007500000000000000000

HTH.
...
jay




More information about the Python-list mailing list