Skip to content

Instantly share code, notes, and snippets.

@ahawker
Created February 5, 2018 19:23
Show Gist options
  • Save ahawker/a56a9c4733d232e37f6166e0156a33c0 to your computer and use it in GitHub Desktop.
Save ahawker/a56a9c4733d232e37f6166e0156a33c0 to your computer and use it in GitHub Desktop.
Snap, Crackle, Pop!
"""
CracklePop
~~~~~~~~~~
A simple fizzbuzz alternative for RC.
Usage: `python3 cracklepop.py`
"""
import sys
def main():
for i in range(1, 101):
divisible_by_3 = i % 3 == 0
divisible_by_5 = i % 5 == 0
if divisible_by_3 and divisible_by_5:
print('CracklePop')
elif divisible_by_3:
print('Crackle')
elif divisible_by_5:
print('Pop')
if __name__ == '__main__':
sys.exit(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment