Skip to content

Instantly share code, notes, and snippets.

@garybernhardt
Created May 19, 2009 04:00
Show Gist options
  • Save garybernhardt/113902 to your computer and use it in GitHub Desktop.
Save garybernhardt/113902 to your computer and use it in GitHub Desktop.
def santa(people):
return dict(zip(people, reversed(people)))
def describe_santa():
bob, george, judy = 'bob jones', 'george jetson', 'judy smith'
def takes_lists_of_people():
santa([bob, george])
def pairs_people_with_eachother():
pairs = santa([bob, george])
assert pairs[bob] == george
assert pairs[george] == bob
def assigns_pairs_to_each_of_three_people():
people = [bob, george, judy]
pairs = santa(people)
assert set(pairs.keys()) == set(pairs.values()) == set(people)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment