Last active
August 29, 2015 14:22
-
-
Save jgstew/76b7bec9f1f4006b431e to your computer and use it in GitHub Desktop.
Fizz Buzz example, for no real reason.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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