Created
April 1, 2019 17:30
-
-
Save timkofu/cdca85a777f690b6a4ae7d0873bf6096 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
class FizzBuzz: | |
def __init__(self): | |
self.current_number = 0 | |
def detect_multiple(self): | |
if (self.current_number % 3 == 0) and (self.current_number % 5 == 0): | |
return "FizzBuzz" | |
elif self.current_number % 3 == 0: | |
return "Fizz" | |
elif self.current_number % 5 == 0: | |
return "Buzz" | |
else: | |
return self.current_number | |
def fizzbuzz(self): | |
for i in range(1,101): | |
self.current_number = i | |
print(self.detect_multiple()) | |
FizzBuzz().fizzbuzz() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment