Lad wrote:
> I have a list
> L={}
> Now I can assign the value
> L['a']=1
> and I have
> L={'a': 1}
> 
> but I would like to have a dictionary like this
> L={'a': {'b':2}}
> 
> so I would expect I can do
> L['a']['b']=2
> 
> but it does not work. Why?
> 
> Thank you for reply
> Rg,
> L.
> 

Hi,

Perhaps what you try to do is something different than what I did here 
but it works for me:

 >>> D={'a':{'b':''}}
 >>> D['a']['b']=2
 >>> D
{'a': {'b': 2}}

-- 
mph
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to