Created
September 29, 2013 08:50
-
-
Save KorbenC/6750593 to your computer and use it in GitHub Desktop.
Classic FizzBuzz test
This file contains hidden or 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
| #!/usr/bin/env python | |
| def fizzbuzz(): | |
| for x in xrange(1, 100): | |
| if x % 5 == 0 and x % 3 == 0: | |
| print "FizzBuzz" | |
| elif x % 3 == 0: | |
| print "Fizz" | |
| elif x % 5 == 0: | |
| print "Buzz" | |
| else: | |
| print x | |
| def main(): | |
| fizzbuzz() | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment