Question: Write a python function totalSales(ThisWeek, PastWeek) that accepts two dictionaries of sales (the current week, and the last week) and combines them into one

Write a python function totalSales(ThisWeek, PastWeek) that accepts two dictionaries of sales (the current

Write a python function totalSales(ThisWeek, PastWeek) that accepts two dictionaries of sales (the current week, and the last week) and combines them into one dictionary by aggregating the sales values. Example: ThisWeek = {'Sun': 1200, 'Mon':1100, 'Tue':800, "Wed':500, 'Thu':600, "Fri':700, 'Sat":900} PastWeek = ('Sun':1100, 'Mon':900, Tue':700, "Wed':800, "Thu: 1000, "Fri':900, 'Sat':1000) Expected output: PastWeek = {'Sun':2300, "Mon':2100, Tue:1500, Wed': 1300, "Thu:1600, "Fri: 1600, 'Sat":1900} I

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The solution to the python function totalSalesThisWeekPastWeek is as follows Python def totalSalesThisWeek PastWeek Combines two dictionaries of sales into one dictionary by aggregating the sales valu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!