Skip to content

Instantly share code, notes, and snippets.

@013231
Created August 27, 2012 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 013231/3490375 to your computer and use it in GitHub Desktop.
Save 013231/3490375 to your computer and use it in GitHub Desktop.
allNum = range(1000*1000)
random.shuffle(allNum)
for promoCodeNeverRepeat in allNum:
doSomethingWith(promoCodeNeverRepeat)
def getCode():
result = allNum[getCode.usedNum]
getCode.usedNum += 1
return result
getCode.usedNum = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment