Dictionary

Nicholas Routledge n.routledge at bigpond.com
Tue Aug 8 07:57:29 EDT 2000


Thanks for your help.
I worked it out. It was because i had white space that needed to be
stripped.
I didn't think about that.

--
cheers,
nick



Nicholas Routledge <n.routledge at bigpond.com> wrote in message
news:ERQj5.26704$c5.75550 at newsfeeds.bigpond.com...
> 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