Skip to content

Instantly share code, notes, and snippets.

@dylankb
Created September 11, 2015 22:02
Show Gist options
  • Save dylankb/67231917eb472784a470 to your computer and use it in GitHub Desktop.
Save dylankb/67231917eb472784a470 to your computer and use it in GitHub Desktop.
def cracklePop(start,stop):
numberList = range(start,stop) #Initialize numberList, a list of integers from 1 - 100.
for num in numberList:
if num % 5 == 0 and num % 3 == 0:
mark = numberList.index(num)
numberList.pop(mark)
numberList.insert(mark,"CracklePop")
elif num % 3 == 0:
mark = numberList.index(num)
numberList.pop(mark)
numberList.insert(mark,"Crackle")
elif num % 5 == 0:
mark = numberList.index(num)
numberList.pop(mark)
numberList.insert(mark,"Pop")
return numberList
print cracklePop(1,101) #Call cracklePop function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment