Created
May 19, 2009 04:00
-
-
Save garybernhardt/113902 to your computer and use it in GitHub Desktop.
This file contains 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
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