> pairs[son][0] = father
> KeyError: 'Steven Bates'
> Where am I going wrong?
A KeyError means you are trying to access an object that does not exist
in the dictionary. And this is true, you haven't added anything for Steven
Bates
yet, but you are trying to access his parents list.
You need
KentThanks again. I have a question (see below).On 26/01/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
Jon Moore wrote:> Hi,>> I have the following dictionary:>> pairs = {"Jon Moore": ["Tony Moore", "Stanley Moore"],
> "Simon Nightingale": ["John Nightingale", "Alan Nightingale"],>
Jon Moore wrote:
> Hi,
>
> I have the following dictionary:
>
> pairs = {"Jon Moore": ["Tony Moore", "Stanley Moore"],
> "Simon Nightingale": ["John Nightingale", "Alan Nightingale"],
> "David Willett": ["Bernard Willet", "Robert Willet"],
> "John Jackson": ["John Jacks
Hi,I have the following dictionary:pairs = {"Jon Moore": ["Tony Moore", "Stanley Moore"], "Simon Nightingale": ["John Nightingale", "Alan Nightingale"],
"David Willett": ["Bernard Willet", "Robert Willet"], "John Jackson": ["John Jackson", "Peter Jackson"], "James S