Created
September 10, 2016 17:54
-
-
Save kentquirk/331718543bf4802d07882681259e7d8c to your computer and use it in GitHub Desktop.
No explicit conditional
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
output = dict() | |
for element in input: | |
item = output.get(element["owner"], []) | |
item.append(element["pet"]) | |
output[element["owner"]] = item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment