Skip to content

Instantly share code, notes, and snippets.

@cnh
Last active December 15, 2015 13:39
Show Gist options
  • Save cnh/5268681 to your computer and use it in GitHub Desktop.
Save cnh/5268681 to your computer and use it in GitHub Desktop.
numbers = range(1,101)
for i in numbers:
if(i%15 == 0): #divisible by both 3 & 5
print 'FizzBuzz'
elif(i%3 == 0): #divisible by 3
print 'Fizz'
elif (i%5 == 0): #divisible by 5
print 'Buzz'
else:
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment