[Tutor] Multi-Dimensional Dictionary that contains a 12 element list.

Paul Kraus pkraus at pelsupply.com
Thu Dec 29 20:23:08 CET 2005

On Wednesday 28 December 2005 11:30 am, Kent Johnson wrote:
> Python lists don't create new elements on assignment (I think Perl lists
> do this?) so for example
> dictionary[(key1, key2)][10] = X
ok so assuming I had a dictionary with 1key that contained a list like so...

How would I increment it or assign it if it didn't exist. I assumed like this.
dict[key1][0] = dictionary.get(key1[0],0) + X

Paul Kraus
PEL Supply Company
Network Administrator
216.267.5775 Voice
216.267.6176 Fax

More information about the Tutor mailing list