Created
March 15, 2015 01:23
-
-
Save clample/908723d5fb7189492330 to your computer and use it in GitHub Desktop.
This file contains 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
i=1 | |
while (i<=100): | |
threeDivides = i%3==0 | |
fiveDivides = i%5==0 | |
if (threeDivides and fiveDivides): | |
print("CracklePop") | |
elif(threeDivides): | |
print("Crackle") | |
elif(fiveDivides): | |
print("Pop") | |
else: | |
print(i) | |
i=i+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cracklepop prints numbers from 1 to 100. If the number is divisible by three, it prints crackle. If the number is divisible by 5, it prints pop. If the number is divisible by three and five, it prints cracklepop.