It does not look nice at all, mainly because you are asking either asking the
question upside down, or not providing enough information.
If a and b are of vastly different sizes, say so. Otherwise, think about your
algorithm, and realize you are asking for things in b if they exist in a:
> dict
Mike:
Many thanks for your solution. It looks really nice.
Mike Erickson wrote:
> * [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
> > Hello:
> > I have next dictionaries:
> > a={'a':0, 'b':1, 'c':2, 'd':3}
> > b={'a':0, 'c':1, 'd':2, 'e':3}
> > I want to put in a new dictionary named c all the ke
James:
Your solution works for me, many, many thanks for your help and many
thanks for the time, teaching and reflections I received from all the
guys that participated in this thread.
James Stroud wrote:
> [EMAIL PROTECTED] wrote:
> > Hello:
> > I have next dictionaries:
> > a={'a':0, 'b':1, 'c'
Fredrik Lundh <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
>
> >> How can I do this with one line of instruction?
> >
> > As a general piece of advice, [...] Don't try to compress things
> > into fewer lines unless that actually makes it clearer to read.
>
> I was about to suggest adding some
Ben Finney wrote:
>> How can I do this with one line of instruction?
>
> Why one line?
>
> As a general piece of advice, try writing dumb, obvious code that
> actually does the transformation you want, and then let us see
> that. Don't try to compress things into fewer lines unless that
> actual
[EMAIL PROTECTED] writes:
> I have next dictionaries:
> a={'a':0, 'b':1, 'c':2, 'd':3}
> b={'a':0, 'c':1, 'd':2, 'e':3}
> I want to put in a new dictionary named c all the keys that are in b
> and re-sequence the values. The result I want is:
> c={'a':0, 'c':1, 'd':2}
Okay, it seems that what you
* [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
> Hello:
> I have next dictionaries:
> a={'a':0, 'b':1, 'c':2, 'd':3}
> b={'a':0, 'c':1, 'd':2, 'e':3}
> I want to put in a new dictionary named c all the keys that are in b
> and re-sequence the values. The result I want is:
> c={'a':0, 'c':1, 'd':2}
Carl Banks wrote:
> Steve Holden wrote:
>
>>[EMAIL PROTECTED] wrote:
>>
>>>Hello:
>>>I have next dictionaries:
>>>a={'a':0, 'b':1, 'c':2, 'd':3}
>>>b={'a':0, 'c':1, 'd':2, 'e':3}
>>>I want to put in a new dictionary named c all the keys that are in b
>>>and re-sequence the values. The result I wan
Ben Finney wrote:
> [EMAIL PROTECTED] writes:
>
>
>>I have next dictionaries:
>>a={'a':0, 'b':1, 'c':2, 'd':3}
>>b={'a':0, 'c':1, 'd':2, 'e':3}
>>I want to put in a new dictionary named c all the keys that are in b
>>and re-sequence the values.
>
>
> They never had a sequence, so you can't "re-
Steve Holden wrote:
> [EMAIL PROTECTED] wrote:
> > Hello:
> > I have next dictionaries:
> > a={'a':0, 'b':1, 'c':2, 'd':3}
> > b={'a':0, 'c':1, 'd':2, 'e':3}
> > I want to put in a new dictionary named c all the keys that are in b
> > and re-sequence the values. The result I want is:
> > c={'a':0,
[EMAIL PROTECTED] wrote:
> Hello:
> I have next dictionaries:
> a={'a':0, 'b':1, 'c':2, 'd':3}
> b={'a':0, 'c':1, 'd':2, 'e':3}
> I want to put in a new dictionary named c all the keys that are in b
> and re-sequence the values. The result I want is:
> c={'a':0, 'c':1, 'd':2}
> How can I do this wi
[EMAIL PROTECTED] wrote:
> Hello:
> I have next dictionaries:
> a={'a':0, 'b':1, 'c':2, 'd':3}
> b={'a':0, 'c':1, 'd':2, 'e':3}
> I want to put in a new dictionary named c all the keys that are in b
> and re-sequence the values. The result I want is:
> c={'a':0, 'c':1, 'd':2}
> How can I do this w
At Tuesday 24/10/2006 21:29, [EMAIL PROTECTED] wrote:
a={'a':0, 'b':1, 'c':2, 'd':3}
b={'a':0, 'c':1, 'd':2, 'e':3}
I want to put in a new dictionary named c all the keys that are in b
and re-sequence the values. The result I want is:
c={'a':0, 'c':1, 'd':2}
How can I do this with one line of in
[EMAIL PROTECTED] writes:
> I have next dictionaries:
> a={'a':0, 'b':1, 'c':2, 'd':3}
> b={'a':0, 'c':1, 'd':2, 'e':3}
> I want to put in a new dictionary named c all the keys that are in b
> and re-sequence the values.
They never had a sequence, so you can't "re-sequence" them.
You have not, p
[EMAIL PROTECTED] wrote:
> Hello:
> I have next dictionaries:
> a={'a':0, 'b':1, 'c':2, 'd':3}
> b={'a':0, 'c':1, 'd':2, 'e':3}
> I want to put in a new dictionary named c all the keys that are in b
> and re-sequence the values. The result I want is:
> c={'a':0, 'c':1, 'd':2}
> How can I do this wi
Hello:
I have next dictionaries:
a={'a':0, 'b':1, 'c':2, 'd':3}
b={'a':0, 'c':1, 'd':2, 'e':3}
I want to put in a new dictionary named c all the keys that are in b
and re-sequence the values. The result I want is:
c={'a':0, 'c':1, 'd':2}
How can I do this with one line of instruction?
I attempted
16 matches
Mail list logo