(continued from previous page from abc import abcabstractmethod import csv from pythonic import ring abstract class for table-format class tableformat(object)""abastract class "" @abstractmethod def heading(selfheader)must be implemented in child class pass @abstractmethod def row(selfrow_data)must be implemented in child class pass text format for table class textformat(tableformat)""text format for table "" def heading(selfheader)print headers for in headerprint("{:> }format( )end='print( def row(selfrow_data)print rows for in row_dataprint("{:> }format( )end='print( this code is copied from datamine py file and modified slightly to include the type of the data def read_file(filenametypesmode='warn')''read csv file and save data in the list '' check for correct mode if mode not in ['warn''silent''stop']raise valueerror("possible modes are 'warn''silent''stop'" ring_data [create empty list to save data with open (filename' 'as frows csv reader(fheader next(rowsskip the header change the types of the columns for row in rowstryrow[ float(row[ ]radius row[ float(row[ ]price row[ int(row[ ]quantity generalized conversion row [d_type(valfor d_typeval in zip(typesrow)except valueerror as errprocess value error only if mode ='warn'(continues on next page rewrite table formatter using inheritance