Skip to content

Instantly share code, notes, and snippets.

@szeitlin
Created February 25, 2014 22:31
Show Gist options
  • Save szeitlin/9219343 to your computer and use it in GitHub Desktop.
Save szeitlin/9219343 to your computer and use it in GitHub Desktop.
fizzbuzz
def fizzbuzz(last):
list = range(1, (last + 1))
for num in list:
if num % 15 == 0:
num = "fizzbuzz"
print str(num)
elif num % 3 == 0:
num = "fizz"
print str(num)
elif num % 5 == 0:
num = "buzz"
print str(num)
else:
print num
fizzbuzz(15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment