Created
August 1, 2017 02:03
-
-
Save jhazelwo/f2afd0ddb69d6e129941376b428bd646 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
#!/usr/bin/env python | |
def is_factor_of(number, factor): | |
if number % factor == 0: | |
return True | |
return False | |
def fizzbuzz(i): | |
fizz = 3 | |
buzz = 5 | |
if is_factor_of(i, fizz) and is_factor_of(i, buzz): | |
return 'fizzbuzz' | |
if is_factor_of(i, fizz): | |
return 'fizz' | |
if is_factor_of(i, buzz): | |
return 'buzz' | |
return str(i) | |
for i in range(1,101): | |
print(fizzbuzz(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment