Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #29953
| References | (3 earlier) <evH6s.1159$U54.270@newsfe01.iad> <CA+vVgJVbkYc=O_fhkSNGPKwF80Jg6X7LTOvdQAJ_agoOQbLOVg@mail.gmail.com> <CALwzidn7ztCJup+kPTVwLFFJj-Hxg5EM0PFsryHzca1T9DA9Aw@mail.gmail.com> <5060CE37.8080409@stoneleaf.us> <CA+vVgJXsGE_yLkmNFVNBKZGdZK7cB5FD+j0u6skhxt4UZrJN3A@mail.gmail.com> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2012-09-24 17:01 -0600 |
| Subject | Re: A little morning puzzle |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1236.1348527696.27098.python-list@python.org> (permalink) |
On Mon, Sep 24, 2012 at 4:07 PM, Dwight Hutto <dwightdhutto@gmail.com> wrote: > 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. Well, to me at least it is clear that when the OP writes "I want to find the *set* of *keys*..." (emphasis added), then setting aside the rest of the problem statement, the result of the algorithm should be a set (or at least something set-like), and the contents of the set should be keys. The posted code produces neither a set nor any keys; it prints out the same predetermined non-key value multiple times.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: A little morning puzzle Peter Otten <__peter__@web.de> - 2012-09-19 14:09 +0200
Re: A little morning puzzle Tobiah <toby@tobiah.org> - 2012-09-20 09:28 -0700
Re: A little morning puzzle Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-22 23:44 -0400
Re: A little morning puzzle alex23 <wuwei23@gmail.com> - 2012-09-23 20:46 -0700
Re: A little morning puzzle Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-24 17:22 -0400
RE: A little morning puzzle "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-09-27 17:58 +0000
Re: A little morning puzzle Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-23 22:51 -0600
Re: A little morning puzzle Ethan Furman <ethan@stoneleaf.us> - 2012-09-24 14:18 -0700
Re: A little morning puzzle Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-24 18:07 -0400
Re: A little morning puzzle Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-24 17:01 -0600
Re: A little morning puzzle Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-24 19:13 -0400
csiph-web