Last active
September 21, 2019 14:39
-
-
Save andrewerb/a61a2fe0d891381f5b5e2b5bf162e786 to your computer and use it in GitHub Desktop.
CracklePop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- 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