Skip to content

Instantly share code, notes, and snippets.

@emergent
Created January 10, 2009 19:02
Show Gist options
  • Save emergent/45528 to your computer and use it in GitHub Desktop.
Save emergent/45528 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
def fizzbuzz(n):
for i in range(n+1):
if i % 15 == 0:
print('FizzBuzz')
elif i % 5 == 0:
print('Buzz')
elif i % 3 == 0:
print('Fizz')
else:
print(i)
if __name__ == '__main__':
import sys
if len(sys.argv) != 2:
print("please input a number")
quit()
fizzbuzz(int(sys.argv[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment