""" Write a program that generates 2d list of prices. Program asks user to enter row and col. You can assume that prices are in range 1 - 50. The store is running the Holiday sale using the following rule: (1)all items that cost $25 and less receive 10% discount (2)all items above $25 receive 30% discount. Use these functions to generate the list and print 2d list in table form. Write function process, that creates 2 one dimensional lists with final prices: first list contains final prices for all items that had original prices $25 and below, and second list contains final prices for all items that had original price above $25. The function also returns AVERAGES final prices for EACH category. Write main to test your program. """ import random def make_2d_list(row, col, min_limit, max_limit): a = [[ 0 for i in range(col)] for j in range(row)] for i in range(row): for j in range(col): a[i][j]=random.randint(min_limit, max_limit) return a def print_table(my_list_2d): row=len(my_list_2d) for i in range(row): print(my_list_2d[i]) def process(prices): list_10=[] list_30=[] row=len(prices) col=len(prices[0]) for i in range(row): for j in range(col): if(prices[i][j]<=25): list_10.append(prices[i][j]*90/100) else: list_30.append(prices[i][j]*70/100) if(len(list_10)>0): ave_10=sum(list_10)/len(list_10) else: ave_10=None if(len(list_30)>0): ave_30=sum(list_30)/len(list_30) else: ave_30=None return list_10, list_30, ave_10, ave_30 def main(): prices=make_2d_list(3,4,1,50) print("original prices") print_table(prices) list_10,list_30,ave_10,ave_30=process(prices) if(ave_10!=None): print("list10",list_10) print("ave10",ave_10) else: print("no items 25 or below") if(ave_30!=None): print("list30",list_30) print("ave30",ave_30) else: print("no items above 25") main()