""" Program 2 (20 points): Write a function ave_letters that takes one parameter - list of strings. The function counts the number of letters (lowercase and uppercase) in each string and store counters in one dimensional list of integers. The function then finds the average number of letters in the strings. Finally, the function returns the list of counters and the average. Write a program to test your function on the list of random strings ( use these functions Links to an external site.) """ import random def ave_letters(list): count=[] for str in list: count_letter=0 for item in str: if(item.isalpha()): count_letter+=1 count.append(count_letter) return count, sum(count)/(len(list)) 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 def main(): list=make_list_string_random(5, 10,10) print(list) count,ave=ave_letters(list) print(count) print(ave) main()