Last active
December 28, 2015 22:09
-
-
Save genghisjahn/7570063 to your computer and use it in GitHub Desktop.
FizzBuzz exercise in python.
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
__author__ = 'genghisjahn' | |
num=1 | |
result = "" | |
while num<=100: | |
if(num % 3 == 0 and num % 5 == 0): | |
result="FizzBuzz" | |
else: | |
if(num % 3 == 0): | |
result="Fizz" | |
elif(num % 5 == 0): | |
result="Buzz" | |
else: | |
result = num | |
print(result) | |
num=num+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment