(continued from previous page 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( csv format for table class csvformat(tableformat)""text format for table "" def heading(selfheader)print headers print(',join(header) def row(selfrow_data)print rows print(",join(row_data) 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'print("invalid datarow is skipped"print('row{}reason {}format(row_numerr)elif mode ='silent'pass do nothing elif mode ='stop'raise raise the exception continue ring_data append(tuple(row) append data in list in the form of tuple (continues on next page rewrite table formatter using inheritance