the next part of the program will loop through all the rows in the spreadsheet add the following code to the bottom of updateproduce py#python updateproduce py corrects costs in produce sales spreadsheet --snip-loop through the rows and update the prices for rownum in range( sheet max_row)skip the first row producename sheet cell(row=rownumcolumn= value if producename in price_updatessheet cell(row=rownumcolumn= value price_updates[producenamewb save('updatedproducesales xlsx'we loop through the rows starting at row since row is just the header the cell in column (that iscolumn awill be stored in the variable producename if producename exists as key in the price_updates dictionary then you know this is row that must have its price corrected the correct price will be in price_updates[producenamenotice how clean using price_updates makes the code only one if statementrather than code like if producename ='garlic'is necessary for every type of produce to update and since the code uses the price_updates dictionary instead of hardcoding the produce names and updated costs into the for loopyou modify only the price_updates dictionary and not the code if the produce sales spreadsheet needs additional changes after going through the entire spreadsheet and making changesthe code saves the workbook object to updatedproducesales xlsx it doesn' overwrite the old spreadsheet just in case there' bug in your program and the updated spreadsheet is wrong after checking that the updated spreadsheet looks rightyou can delete the old spreadsheet you can download the complete source code for this program from ideas for similar programs since many office workers use excel spreadsheets all the timea program that can automatically edit and write excel files could be really useful such program could do the followingread data from one spreadsheet and write it to parts of other spreadsheets read data from websitestext filesor the clipboard and write it to spreadsheet automatically "clean updata in spreadsheets for exampleit could use regular expressions to read multiple formats of phone numbers and edit them to singlestandard format working with excel spreadsheets