(continued from previous page row_dict 'daterow[ ]'metalrow[ ]'radiusrow[ ]'pricerow[ ]'quantityrow[ row_dict ring(row[ ]row[ ]row[ ]row[ ]row[ ]use below or above line row_dict ringdate row[ ]metal row[ ]radius row[ ]price row[ ]quantity row[ ring_data append(row_dict return ring_data table formatter def print_table(list_namecol_name=['metal''radius']out_format=textformat())note that class is passed here ""print the formatted output "" for in col_nameprint header print("{:> }format( )end='print(print empty line for in list_nameprint values for in col_nameprint("{:> }format(str(getattr(lc)))end='print( invoke class-method for printing heading out_format heading(col_nameclass is passed to out_format for in list_namestore row in list row_data [str(getattr(lc)for in col_nameout_format row(row_datapass rows to class-method row( def main()list correct types of columns in csv file types =[strstrfloatfloatint read file and save data in list list_data read_file('price csv'types formatted output print_table(list_dataprint(print_table(list_data['metal''radius''price']out_format=textformat() print(print_table(list_data['metal''radius''price']out_format=csvformat() if __name__ ='__main__'(continues on next page rewrite table formatter using inheritance