Created
August 30, 2016 02:05
-
-
Save MrwanBaghdad/a57c1006e9dfbcc1bf4ea16f22e01759 to your computer and use it in GitHub Desktop.
generating random list of ascii strings for python
This file contains hidden or 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
| import math; | |
| import random; | |
| import string; | |
| def str_gen(n): | |
| return "".join(random.sample(string.ascii_letters,n)); | |
| def list_gen(m,n): | |
| li=[]; | |
| for i in range(1,n): | |
| li.append(str_gen(m)); | |
| return li; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment