removing dictionary key-pair

bruno at modulix onurb at xiludom.gro
Fri Jun 9 10:25:58 EDT 2006


bruno at modulix wrote:
> JD wrote:
> 
>>Hello,
>>
>>I try to remove a dictionary key-pair (remove an entry), 
>>but I'm unsuccessful. Does anyone know how to achieve this?
>>
>>Thanks
> 
> 
> mydict = {"key" : "value"}
> del mydict(key)

grmf... Typo. This is:

del mydict['key']

of course...
-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list