> I thought that the dictionaries would be like this:
>> Name || key || value
> -----------------------------------------
Actually you just described a relational data schema. You would
almost certainly be better off moving to a proper relatinal
database such as MySQL, Postgres or SqlLite. In the long term
it will be much easier to work with.
> - is it possible for a dictionary to save a class as a value ? Would
> this actually make sense in this case ?
Yes, and more usefully instances of classes.
> Someone also suggests using dictionaries instead of lists:
>> - is it possible for a dictionary to save another dictionary as a
> value ?
Yes, you can store any object as a value.
Its quite common to have nested dictionaries:
D = { "first" : { "second" : { "third" : 3, "fourth" : 4 },
"fifth" : { "sixth" : 6, "seventh" : 7 } },
"eight" : { "short" : 0},
}
print D['first']['fifth']['seventh']
print D['eighth']['short']
etc...
You will find more on this in the section on collection types
within the Raw Materials topic in my new tutor
HTH
Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld/tutor2