Skip to content

Instantly share code, notes, and snippets.

@kentquirk
Last active September 16, 2016 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kentquirk/dfeb806df91b2688b5fc3f47a66bacd6 to your computer and use it in GitHub Desktop.
Save kentquirk/dfeb806df91b2688b5fc3f47a66bacd6 to your computer and use it in GitHub Desktop.
Set up output first
output = dict([[e["owner"], []] for e in input])
for element in input:
output[element["owner"]].append(element["pet"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment