Skip to content

Instantly share code, notes, and snippets.

@philippbosch
Created December 16, 2014 11:40
Show Gist options
  • Save philippbosch/2cffb96c0a02b51fa9bf to your computer and use it in GitHub Desktop.
Save philippbosch/2cffb96c0a02b51fa9bf to your computer and use it in GitHub Desktop.
Create random string in Python
import random
import string
length=10
code = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment