(continued from previous pagecheck 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 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 append data in list in the form of tuple ring_data append(tuple(row)return ring_data def main()ring_data read_file('price csv'total rows in the file print("total rows"len(ring_data)total price calculation total_price for row in ring_datatotal_price +row[ row[ print("total price{: }format(total_price)if __name__ ='__main__'main(run the above code and we will get the following resultspython datamine py total rows total price nowopen the python shell and run the below code see the difference"previously we returned total_price from the functiontherefore we could perform no more operation on the data butnow we have the data in the form of listtherefore we can perform operation on the data from datamine import read_file ring_data read_file('price csv'len(ring_data ring_data[ (continues on next page building data structure from file