Dictionary

Nicholas Routledge n.routledge at bigpond.com
Tue Aug 8 06:03:23 EDT 2000


Hi all,

i'm new to python. could anyone see what might cause this error?

in a program i have a tuple called tup.  tup[0] is 'A'.
i also have a dictionary called dict. dict looks like this,

dict = {'A': 100}

now in my program i try to access dict like this,
dict[tup[0]]

it gives me a key error.  any ideas?

--
cheers,
nick








More information about the Python-list mailing list