A little morning puzzle

Ian Kelly ian.g.kelly at gmail.com
Mon Sep 24 00:51:53 EDT 2012


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.
>
> 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
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.



More information about the Python-list mailing list