How to append to a dictionary

Sybren Stuvel sybrenUSE at
Fri May 19 08:08:55 EDT 2006

Harlin Seritt enlightened us with:
> I have some code here:
> groups = {'IRISH' : 'green', 'AMERICAN' : 'blue'}
> I want to add another key: 'ITALIAN' : 'orange'
> How do I append this to 'groups'?

groups['ITALIAN'] = 'orange'

The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
                                             Frank Zappa

More information about the Python-list mailing list