Skip to content

Instantly share code, notes, and snippets.

@hellais
Created April 11, 2014 19:50
Show Gist options
  • Save hellais/10496214 to your computer and use it in GitHub Desktop.
Save hellais/10496214 to your computer and use it in GitHub Desktop.
random int generation.
# random int generation as gist.
randint = lambda a,b: a + int(''.join("%x" % ord(i) for i in os.urandom(b-a+1)), 16) % (b - a + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment