How to append to a dictionary

Tim Chase python.list at tim.thechases.com
Fri May 19 14:05:27 CEST 2006


> groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'}
> 
> I want to add another key: 'ITALIAN' : 'orange'
> 
> How do I append this to 'groups'?

groups['ITALIAN'] = 'orange'

as described at

http://docs.python.org/tut/node7.html#SECTION007500000000000000000

-tkc






More information about the Python-list mailing list