Skip to content

Instantly share code, notes, and snippets.

@clample
Created March 15, 2015 01:23
Show Gist options
  • Save clample/908723d5fb7189492330 to your computer and use it in GitHub Desktop.
Save clample/908723d5fb7189492330 to your computer and use it in GitHub Desktop.
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
@clample
Copy link
Author

clample commented Mar 15, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment