On Oct 7, 10:16 am, "Barak, Ron" <[EMAIL PROTECTED]> wrote:
> Would the following be suitable data structure:
> ...
> struct = {}
> struct["Nebraska"] = "Wabash"
> struct["Nebraska"]["Wabash"] = "Newville"
> struct["Nebraska"]["Wabash"]["Newville"]["topics"] = "Math"
> struct["Nebraska"]["Wabash"]["Newville"]["Math"]["Max Allowed Students"] = 20
> struct["Nebraska"]["Wabash"]["Newville"]["Math"]["Current enrolled Students"]
> = 0
> ...
That's not quite right as stated.
>>> struct = {}
>>> struct["Nebraska"] = "Wabash"
>>> struct["Nebraska"]["Wabash"] = "Newville"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' object does not support item assignment
--
http://mail.python.org/mailman/listinfo/python-list