""" Write a program that generates a list of characters. Use this function. Write a function def count_e_row(list2d,i) that counts a number of times letter 'e' appears in row i in two dimensional list list2d. PAY ATTENTION, this function takes care of ONE row only. Write a function process that counts number of times letter e appears in each row. Function stores counters in one dimensional list and returns this list. Write main that asks user to enter row and col, generate random list of chars, prints the list, uses function process and finds and prints the number of times letter 'e' appears in each row (your program will print one dimensional list of counters) """ import random def make_list_random_char2d(row, col, min, max): list2d=[[0 for i in range(col)] for j in range(row)] for i in range(row): for j in range(col): list2d[i][j]=(chr)(random.randint(min,max)) return list2d def print_matrix(list2d): row=len(list2d) #col=len(list2d[0]) for i in range(row): print(list2d[i]) def count_e_row(list2d,i): return list2d[i].count('e') """ count_e=0 for item in list2d[i]: if(item=='e'): count_e+=1 return count_e """ def process(list2d): row=len(list2d) count_list=[] for i in range(row): count_list.append(count_e_row(list2d,i)) return count_list def main(): #find the row with max number of 'e' letters list2d=make_list_random_char2d(7,7,97, 122) print_matrix(list2d) count_list=process(list2d) print("counters", count_list) max_value=max(count_list) print("max_value",max_value) max_index=count_list.index(max_value) print("row number with max 'e'",max_index) main()