Skip to content

Instantly share code, notes, and snippets.

@genghisjahn
Last active December 28, 2015 22:09
Show Gist options
  • Save genghisjahn/7570063 to your computer and use it in GitHub Desktop.
Save genghisjahn/7570063 to your computer and use it in GitHub Desktop.
FizzBuzz exercise in python.
__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