> greg whittier wrote:
>> On Thu, Mar 12, 2009 at 4:24 PM, ski wrote:
>> mylist = [{'a': 'x123', 'b':'12'}, {'a': 'x234', 'b': 'd33', 'c':
>> 'a23'}, {'a': 'x234', 'c': 'XX123'} ]
>>> where mylist has nth number of dictionaries and i want to merge the
>>> values
>>> of the keys that a
how would you do this for a specific key instead of all the keys?
greg whittier wrote:
On Thu, Mar 12, 2009 at 4:24 PM, ski wrote:
Hello,
I have this issue, which I am unsure on how to solve.
mylist1 = {'a': 'x123', 'b':'12'}
mylist2 = {'a': 'x234', 'c': 'a23'}
for k in mylist2:
... if
On Thu, Mar 12, 2009 at 4:24 PM, ski wrote:
> Hello,
> I have this issue, which I am unsure on how to solve.
>
mylist1 = {'a': 'x123', 'b':'12'}
mylist2 = {'a': 'x234', 'c': 'a23'}
for k in mylist2:
> ... if k in mylist1:
> ... mylist1[k] = [mylist1[k], mylist2[k]]
>
Hello,
I have this issue, which I am unsure on how to solve.
>>> mylist1 = {'a': 'x123', 'b':'12'}
>>> mylist2 = {'a': 'x234', 'c': 'a23'}
>>> for k in mylist2:
... if k in mylist1:
... mylist1[k] = [mylist1[k], mylist2[k]]
... else:
... mylist1[k] = mylist2[k]
...