Skip to content

Instantly share code, notes, and snippets.

@kentquirk
Last active September 10, 2016 18:02
Show Gist options
  • Save kentquirk/a19b3ed7b268b0cf437b8719408fe732 to your computer and use it in GitHub Desktop.
Save kentquirk/a19b3ed7b268b0cf437b8719408fe732 to your computer and use it in GitHub Desktop.
Concatenation and tuples
output = dict()
for element in input:
output[element["owner"]] = output.get(element["owner"], ()) + (element["pet"],)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment