Skip to content

Instantly share code, notes, and snippets.

@DomNomNom
Created April 10, 2014 10:56
Show Gist options
  • Save DomNomNom/10368133 to your computer and use it in GitHub Desktop.
Save DomNomNom/10368133 to your computer and use it in GitHub Desktop.
actions = {
(False, False) : lambda x: x,
(True, False) : lambda x: "fizz",
(False, True ) : lambda x: "buzz",
(True, True ) : lambda x: "fizzBuzz",
}
print '\n'.join([ actions[x%3==0, x%5==0](x) for x in xrange(1,101) ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment