""" Write a program that randomly generates a 2d-list of characters limited to a, b, and c (use range 97 - 99) Print the list in table form. Write a function process that counts the number of a's, b's and c's, stores counters in one-dimensional list and returns the list. Write main that prints the list of counters and finds a most frequent letter in the list. """ import random def make_random2d_char(row, col, min, max): return [[(chr)(random.randint(min,max)) for i in range(col)] for j in range(row)] def print_matrix(list2d): for list in list2d: print(list) def main(): list2d=make_random2d_char(5,3,97,99) print_matrix(list2d) count=[] count_a=0 count_b=0 count_c=0 for list in list2d: for item in list: if(item=='a'): count_a+=1 elif(item=='b'): count_b+=1 elif(item=='c'): count_c+=1 count.append(count_a) count.append(count_b) count.append(count_c) max_num=max(count) max_index=count.index(max_num) print("counters",count) print("the max char is", (chr)((ord)('a')+max_index)) main()