Created
June 29, 2014 17:56
-
-
Save alfranz/58b5580b3dc5513f3ee0 to your computer and use it in GitHub Desktop.
FizzBuzz in 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
# This is my first gist code snippet | |
# It's just the popular FizzBuzz function coded in Python | |
def fizzbuzz(): | |
for i in range(101): | |
if (i%3==0) and (i%5==0): | |
print "FizzBuzz this is", i | |
elif i%3==0: | |
print "Fizz this is", i | |
elif i%5==0: | |
print "Buzz this is", i | |
else: | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment