Answer to Question #268064 in Python for Caleb

Question #268064

Write a Python program to access the Furniture spreadsheet, update the price of tables, and then create a new excel spreadsheet called updatedfurniture. Create a dictionary for the price updates and update the prices via a loop, increasing the row number to include all the rows in the spreadsheet. Do not change the formatting of the original spreadsheet. Be sure to check your updatedFurniture spreadsheet to verify that the Total price of the furniture increased. The new Total price amount should be $273,938.20.

1
Expert's answer
2021-11-18T15:19:44-0500
import openpyxl
from pathlib import Path


data = {}
data['dict1'] = {}


ex_file = Path(Path.home(), 'FormaterPythonUniversity', 'Template.xlsx')


#here you will add your data with your numbers
wb_obj = openpyxl.load_workbook(ex_file) 


# Read the active sheet:
sheet = wb_obj.active




for i, row in enumerate(sheet.iter_rows(values_only=True)):
    data['Full Name'] = row[0]
    print(row[0])
    data['dict1']['Work email address'] = row[1]
    data['dict1']['Start date'] = row[2]
    data['dict1']['Manager name'] = row[3]
    data['dict1']['Manager email address'] = row[4]
    data['dict1']['Category'] = row[5]
uptated = data["dict1"]["ctaegory"] = 273938.20 
print(data)      

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS