Re: [Tutor] assigning list to keys

2009-07-14 Thread bob gailer
Christian Witts wrote: Todd Matsumoto wrote: Hello, The other day I needed to pack a dictionary, the value of each key was a list. In the code I was packing the list and the dictionary at the same time. First I tried something like this: list = [] dict = {} x = 1 dict['int'] = list.append(

Re: [Tutor] assigning list to keys

2009-07-14 Thread Kent Johnson
On Tue, Jul 14, 2009 at 2:58 AM, Todd Matsumoto wrote: > Hello, > > The other day I needed to pack a dictionary, the value of each key was a > list. In the code I was packing the list and the dictionary at the same time. > First I tried something like this: > > list = [] > dict = {} > x = 1 > > d

Re: [Tutor] assigning list to keys

2009-07-14 Thread Christian Witts
Todd Matsumoto wrote: Hello, The other day I needed to pack a dictionary, the value of each key was a list. In the code I was packing the list and the dictionary at the same time. First I tried something like this: list = [] dict = {} x = 1 dict['int'] = list.append(x) The result was {'int'

Re: [Tutor] assigning list to keys

2009-07-14 Thread wesley chun
> The other day I needed to pack a dictionary, the value of each key was a > list. In the code I was packing the list and the dictionary at the same time. > First I tried something like this: > > list = [] > dict = {} > x = 1 > > dict['int'] = list.append(x) > > The result was {'int': None}. Why

[Tutor] assigning list to keys

2009-07-14 Thread Todd Matsumoto
Hello, The other day I needed to pack a dictionary, the value of each key was a list. In the code I was packing the list and the dictionary at the same time. First I tried something like this: list = [] dict = {} x = 1 dict['int'] = list.append(x) The result was {'int': None}. Why is the valu