Dynamic append in a dictionnary object ...

Sean 'Shaleh' Perry shaleh at valinux.com
Thu Mar 15 15:19:11 EST 2001


On 15-Mar-2001 Furax wrote:
> Hi,
> I'm pretty new to Python.
> I cannot figure out, reading the documentation, how I can dynamicaly add a
> new pair in a dictionnary ?
> 

if not foo.has_key(key):
    foo[key] = value






More information about the Python-list mailing list