Skip to content

Instantly share code, notes, and snippets.

@dtanham
Created October 22, 2017 17:47
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 dtanham/0de157f8b498c1ef413fb9ab0ed3b7db to your computer and use it in GitHub Desktop.
Save dtanham/0de157f8b498c1ef413fb9ab0ed3b7db to your computer and use it in GitHub Desktop.
Generate a random string using lowercase ASCII characters and digits
import random, string
def random_string(length):
''.join(random.choice(string.ascii_lowercase+string.digits) for i in range(length))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment