Skip to content

Instantly share code, notes, and snippets.

@jonalmeida
Created February 27, 2014 18:31
Show Gist options
  • Save jonalmeida/9255998 to your computer and use it in GitHub Desktop.
Save jonalmeida/9255998 to your computer and use it in GitHub Desktop.
#!/bin/env python
for x in xrange(1, 101):
# Calculate once, refer to the results again instead of re-calculating
isFive = (x%5 == 0)
isThree = (x%3 == 0)
if(isFive & isThree):
print "CracklePop"
elif(isFive):
print "Pop"
elif(isThree):
print "Crackle"
else:
print x
isFive = False
isThree = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment