Re: [Tutor] idiomatic way of merging two dictionaries
by Lie Ryan other posts by this author
Nov 4 2009 3:21AM messages near this date
[Tutor] idiomatic way of merging two dictionaries
|
Re: [Tutor] idiomatic way of merging two dictionaries
Amit Sethi wrote:
> Hi , I am trying to merge(I am not sure if that is the right term)
> dictionaries like this
>
> dict1 ={'a':4,'b':3,'v':7,'h':4}
> dict2={'a':5,'v':4,'k':3}
> dict3 would be {'a':[4,5],'b':[3,4],'v':[7,4],'k':[0,3],'h':[4,0]}
>
I can't see what you're trying to do there. is 'b' supposed to be 3,4
or 0,3?
And is th ordering between the list (i.e. 'a':[4, 5] and 'a':[5, 4])
significant?
_______________________________________________
Tutor maillist - Tutor@[...].org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Thread:
Amit Sethi
Lie Ryan
Alan Gauld
|