I am trying to discover the syntax for call on a dictionary of lists by
key and index.

The data structure looks like this:

dol = {'key1':['li1','li2','li3'],'key2':['li1','li2','li3'],\
'key3':['li1'li2,'li3','']}

The keys are passed to a function as arguments, and I want the value of
the specified list index.  This is what I *thought* it would look like:

dol.key(argument)[0] # would return li1 when argument equals key1

But that's wrong.  The error I get is this:
AttributeError: 'dict' object has no attribute 'key'

I don't know how to interpret that error (well, I know I screwed up, but
... :-)  Thanks.
-- 

yours,

William

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to