Skip to content

Instantly share code, notes, and snippets.

@4Kaylum
Last active September 12, 2016 11:34
Show Gist options
  • Save 4Kaylum/4f14ee909db43e6685aed3de7c929066 to your computer and use it in GitHub Desktop.
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.
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