Skip to content

Instantly share code, notes, and snippets.

@bjhaid
Created November 20, 2013 03:07
Show Gist options
  • Save bjhaid/7557022 to your computer and use it in GitHub Desktop.
Save bjhaid/7557022 to your computer and use it in GitHub Desktop.
Fizzbuzz in python
def fizzbuzz(num):
i = 0
while (i < num):
if (i % 15) == 0:
print "fizzbuzz"
elif (i % 5) == 0:
print "Buzz"
elif (i % 3) == 0:
print "Fizz"
else:
print i
i += 1
fizzbuzz(1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment