Skip to content

Instantly share code, notes, and snippets.

@MrwanBaghdad
Created August 30, 2016 02:05
Show Gist options
  • Select an option

  • Save MrwanBaghdad/a57c1006e9dfbcc1bf4ea16f22e01759 to your computer and use it in GitHub Desktop.

Select an option

Save MrwanBaghdad/a57c1006e9dfbcc1bf4ea16f22e01759 to your computer and use it in GitHub Desktop.
generating random list of ascii strings for python
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