import random #this function generates the string #using random numbers and conversion #to character #function returns randomly generated string def randomString(size): #this function generates the string #using random numbers and conversion #to character #function returns randomly generated string my_string="" for i in range(size): num=random.randint(33, 126) letter=chr(num) my_string=my_string+letter #could be written #my_string=my_string+chr(random.randint(33,126)) return my_string #this functin creates list of random strings, each random string has a different #length which is generated within the function def make_list_string_random(size, min, max): my_list=[] for i in range(size): str_len=random.randint(min, max) new_str = randomString(str_len) my_list.append(new_str) return my_list