Skip to content

Instantly share code, notes, and snippets.

@andrewerb
Last active September 21, 2019 14:39
Show Gist options
  • Select an option

  • Save andrewerb/a61a2fe0d891381f5b5e2b5bf162e786 to your computer and use it in GitHub Desktop.

Select an option

Save andrewerb/a61a2fe0d891381f5b5e2b5bf162e786 to your computer and use it in GitHub Desktop.
CracklePop
# -*- coding: utf-8 -*-
"""CracklePop in Python 3"""
__author__ = "Andrew Erb"
def cracklepop(x):
if (x%3==0 and x%5==0):
return "CracklePop"
if (x%3==0):
return "Crackle"
if (x%5==0):
return "Pop"
return x
def main():
for num in range(1,101):
print(cracklepop(num))
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment