(continued from previous pageprint(linedate,metal,radius,price,quantity "","gold", , , "","silver", , , "","iron", , , "","gold", , , "","copper", , , "","iron", , , next close the file once the file is closed than we can not perform further operation on buffer close( close(for line in rfile is closedtherefore can not be accessed print(linetraceback (most recent call last)file ""line in valueerrori/ operation on closed file with open statement in this section'with openstatement is used to read the file notedo not forget to close the file using close(command furtherfile will be closed automaticallyif it is open using 'withstatementas shown in this section this method is quite useful when we write the codes in the filesinstead of python-shell in the below codethe file is open using 'withstatement therefore it will be closed as soon as the 'withstatement ends therefore buffer will not be accessible outside the 'withstatement for example in the below codeline generates the erroras buffer 'wis outside the 'withstatement with open('price csv'' 'as wdata read(print(dataprint the data date,metal,radius,price,quantity "","gold", , , "","silver", , , "","iron", , , "","gold", , , "","copper", , , "","iron", , , for lines in wfile is already closed (continues on next page basic file operations