Append a new value to dict

jdd jeremiah.dodds at gmail.com
Mon Oct 13 07:30:26 EDT 2008


On Oct 13, 7:21 am, Pat <P... at junk.com> wrote:

> Is there a better/easier way to code this in Python than the
> obtuse/arcane setdefault code?

foo = {'bar': 'baz'}
foo.update({'quux': 'blah'})



More information about the Python-list mailing list