Skip to content

Instantly share code, notes, and snippets.

@jgstew
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgstew/76b7bec9f1f4006b431e to your computer and use it in GitHub Desktop.
Save jgstew/76b7bec9f1f4006b431e to your computer and use it in GitHub Desktop.
Fizz Buzz example, for no real reason.
# example FizzBuzz
def FizzBuzz(iMax = 100):
for num in xrange(1,iMax+1):
msg = ''
if num % 3 == 0:
msg += 'Fizz'
if num % 5 == 0:
msg += 'Buzz'
print msg or num
if __name__ == '__main__':
FizzBuzz()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment