Re: [Tutor] Adding items to dictionaries

2006-01-26 Thread Alan Gauld
> 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

Re: [Tutor] Adding items to dictionaries

2006-01-26 Thread Jon Moore
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"],>  

Re: [Tutor] Adding items to dictionaries

2006-01-26 Thread Kent Johnson
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

[Tutor] Adding items to dictionaries

2006-01-26 Thread Jon Moore
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