Created
September 10, 2016 19:26
-
-
Save kentquirk/fc565b2d3cc11981e4d2d27e0c2e462c to your computer and use it in GitHub Desktop.
Python one-liner broken down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# broken down for "readability" | |
output = dict( | |
[ | |
(o, [e["pet"] for e in input if e["owner"] == o]) | |
for o in | |
set([i["owner"] for i in input]) | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment