[Tutor] Bigrams and nested dictionaries

Michael Broe mbroe at columbus.rr.com
Wed Mar 29 04:03:30 CEST 2006


Well I ran into an interesting glitch already. For a dictionary D, I  
can pull out a nested value using this syntax:

 >>> D['b']['a']
23

and I can assign to this dictionary using

 >>> D['d'] = {'a':7, 'b':0'}

but I can't assign like this:

 >>> D['d']['c'] = 1
TypeError: object does not support item assignment.

hmmm.




More information about the Tutor mailing list