Skip to content

Instantly share code, notes, and snippets.

@borntyping
Created February 13, 2014 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borntyping/8986555 to your computer and use it in GitHub Desktop.
Save borntyping/8986555 to your computer and use it in GitHub Desktop.
def fizzbuzz(n):
for i in range(n):
if i % 3 == 0 and i % 5 == 0:
print("fizzbuzz")
elif i % 3 == 0:
print("fizz")
elif i % 5 == 0:
print("buzz")
else:
print(i)
if __name__ == '__main__':
fizzbuzz(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment