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...
dictionary[key1][0]

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
www.pelsupply.com
=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to