A little morning puzzle

Dwight Hutto dwightdhutto at gmail.com
Mon Sep 24 18:07:20 EDT 2012


On Mon, Sep 24, 2012 at 5:18 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> Ian Kelly wrote:
>>
>> On Sat, Sep 22, 2012 at 9:44 PM, Dwight Hutto <dwightdhutto at gmail.com>
>> wrote:
>>>
>>> Why don't you all look at the code(python and C), and tell me how much
>>> code it took to write the functions the other's examples made use of
>>> to complete the task.n in or register.
>>>
>>> Just because you can use a function, and make it look easier, doesn't
>>> mean the function you used had less code than mine, so if you look at
>>> the whole of what you used to make it simpler, mine was on point.
>>
>>
>> I understood the sarcastic comments (the first one, at least) to be
>> referring to your solution as bad not due to complexity (I actually
>> thought it was quite simple), but because it does not solve the
>> problem as stated.  The problem posed by the OP was to find a set of
>> common keys that are associated with the same values in each dict.

>> Your solution takes only one predetermined key-value pair and counts
>> how many times it occurs in the dicts, which isn't even close to what

They stated:

I have a list of dictionaries.  They all have the same keys.  I want to find the
set of keys where all the dictionaries have the same values.  Suggestions?

No, to me it meant to find similar values in several dicts with the
same key, and value. So I created several dicts, and some with the
same key and value, and showed the matches.

The OP can comment as to whether that is the correct interpretation of
the situation.


>> was requested.  With your comment of "Might be better ones, though", I
>> actually thought that you were aware of this and were being
>> intentionally satirical.

I am. I just write out the algorithm as I understand the OP to want
it, to give my version of the example.

-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com



More information about the Python-list mailing list