Skip to content

Instantly share code, notes, and snippets.

@dfetterman
Created June 11, 2019 12:52
Show Gist options
  • Save dfetterman/3b31f4318d177d5272ca2e782e2565cf to your computer and use it in GitHub Desktop.
Save dfetterman/3b31f4318d177d5272ca2e782e2565cf to your computer and use it in GitHub Desktop.
Dane Fetterman's version of FizzBuzz
for x in range(1, 101):
if (x % 5 == 0) and (x % 3 == 0):
print('FizzBuzz')
elif x % 5 == 0: #means x is exactly divisible by 5, therefor it is a multiple of 5
print('Buzz')
elif x % 3 == 0:
print('Fizz')
else:
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment