Skip to content

Instantly share code, notes, and snippets.

@yjzhang
Created February 5, 2014 20:27
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 yjzhang/c8093e11a487306bfad3 to your computer and use it in GitHub Desktop.
Save yjzhang/c8093e11a487306bfad3 to your computer and use it in GitHub Desktop.
Making a random string
from random import randint
def random_string(n):
return ''.join(chr(randint(0, 25) + ord('a')) for i in range(n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment