Skip to content

Instantly share code, notes, and snippets.

@blackrobot
Created December 8, 2010 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackrobot/733532 to your computer and use it in GitHub Desktop.
Save blackrobot/733532 to your computer and use it in GitHub Desktop.
A Python recipe for Egg Nog
#!/usr/bin/env python
from measurments.abstract import SPRINKLE
from delicious import GOOD
def mix_ingredients(ingredients):
mixture = []
for key in ingredients.iterkeys():
mixture.append("%s: %s" % (key, ingredients[key]))
return mixture
if __name__ == '__main__':
ingredients = {
'egg_yolks': 12,
'lbs_sugar': 1,
'cups_rum': 2,
'cups_bourbon': 2,
'quarts_whipping_cream': 2,
'egg_whites': 12,
'nutmeg': SPRINKLE,
}
egg_nog = mix_ingredients(ingredients)
assert egg_nog is GOOD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment