Created
January 17, 2012 16:51
-
-
Save teenst/1627456 to your computer and use it in GitHub Desktop.
FizzBuzz by python
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
#!/usr/bin/env python | |
# http://www.aoky.net/articles/jeff_atwood/why_cant_programmers_program.htm | |
for i in xrange(1,101): | |
if i % 3 == 0 and i % 5 == 0: | |
print 'FizzBuzz' | |
elif i%3 == 0: | |
print 'Fizz' | |
elif i % 5 == 0: | |
print 'Buzz' | |
else: | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment