[Tutor] appending/updating values dict key value pairs

Sivaram Neelakantan nsivaram.net at gmail.com
Sat Jun 22 19:52:36 CEST 2013


On Sat, Jun 22 2013,Mark Lawrence wrote:


[snipped 7 lines]

>>>>> b = { 'a': [4, 5]}
>>>>> list.append(b.get('a'),'c')
>>>>> b
>> {'a': [4, 5, 'c']}
>>>>>
>>
>>
>> as in, shouldn't it be
>>
>> b['a'] = list.append(b.get('a'),'c')
>>
>> which doesn't seem to work.
>>
>>   sivaram
>>   --
>
> b['a'].append('c')


arrgh! I should have known this.  Thank you for making it obvious to
 the noob.

 sivaram
 -- 



More information about the Tutor mailing list