Last active
September 12, 2016 11:34
-
-
Save 4Kaylum/4f14ee909db43e6685aed3de7c929066 to your computer and use it in GitHub Desktop.
Says 'fizz' on multiples of 3, 'buzz' on multiples of 5, and 'fizzbuzz' on both.
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
def checkNum(number): | |
if number % 3 == 0 and number % 5 == 0: | |
return "FizzBuzz" | |
elif number % 3 == 0: | |
return "Fizz" | |
elif number % 5 == 0: | |
return "Buzz" | |
return number | |
for i in range(101): | |
print(checkNum(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment