Created
February 5, 2014 20:27
-
-
Save yjzhang/c8093e11a487306bfad3 to your computer and use it in GitHub Desktop.
Making a random string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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