Skip to content

Instantly share code, notes, and snippets.

@rrreeeyyy
Last active August 29, 2015 14:05
Show Gist options
  • Save rrreeeyyy/1a11c49051a695d4c729 to your computer and use it in GitHub Desktop.
Save rrreeeyyy/1a11c49051a695d4c729 to your computer and use it in GitHub Desktop.
FIzzBuzz.py
class FizzBuzz(object):
def __init__(self):
self.Buzz = lambda n: n % 5 == 0
self.Fizz = lambda n: n % 3 == 0
def call(self, n):
return ''.join([k for k, v in self.__dict__.items() if v(n)]) or n
print [FizzBuzz().call(n) for n in range(1, 101)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment