Last active
September 10, 2016 17:50
-
-
Save kentquirk/c9b382c8d467e17f3935981022c9c5d7 to your computer and use it in GitHub Desktop.
Simple python
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 = {} | |
for element in input: | |
if output.has_key(element["owner"]): | |
output[element["owner"]].append(element["pet"]) | |
else: | |
output[element["owner"]] = [element["pet"]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment