Skip to content

Instantly share code, notes, and snippets.

@DhashS
Created July 23, 2017 04:11
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 DhashS/5d99e7adc63fcc234dd985318c803f2b to your computer and use it in GitHub Desktop.
Save DhashS/5d99e7adc63fcc234dd985318c803f2b to your computer and use it in GitHub Desktop.
CracklePop
# run with python cracklepop.py
from __future__ import print_function
def decision(n):
if n % 5 == 0 and n % 3 == 0:
return "CracklePop"
elif n % 5 == 0:
return "Pop"
elif n % 3 == 0:
return "Crackle"
else:
return n
def main():
print([decision(x) for x in range(1, 101)])
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment