Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume that a firm uses a nested dictionary to maintain the information on annual sales made from various sales strategies for 2018, 2019, and
Assume that a firm uses a nested dictionary to maintain the information on annual sales made from various sales strategies for 2018, 2019, and 2020. {'2018': {"Radio Sales": 5000, "TV Sales": 26000, "Direct-Mail Sales": 1000, "Telephone Sales": sales_3_years 26000}, 0}, '2019': {"TV Sales": 26000, "Online Sales": 37000, "Telephone Sales": 9000, "Radio Sales": 300 '2020': {"Telephone Sales": 8000, "TV Sales": 19000, "Online Sales": 107000}} Write a comprehension to output the annual sales made from all sales strategies for each year. Your output should look like the following (Hint: use sum() on the return value of .values()): {'2018': 58000, 2019': 75000, 2020': 134000} Write a comprehension to figure out which strategy creates the highest sales for each year. Your output should look like the following: {'2018': [ 'TV Sales', 'Telephone Sales' ], '2019': [ 'Online Sales'], '2020': ['Online Sales']} Write a (possibly nested) for loop to answer: How many distinct strategies have been used? What are the total sales made from them for the 3 consecutive years? Store your result in a dictionary that looks like the following (the order in which entries are listed can be different): {'Radio Sales': 8000, 'TV Sales': 71000, 'Direct-Mail Sales': 1000, 'Telephone Sales': 44000} 43000 ate Online Sales': 1 Go to Settings to activate Windows.
Step by Step Solution
★★★★★
3.42 Rating (146 Votes )
There are 3 Steps involved in it
Step: 1
Nested dictionary comprehension to output annual sales ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started