Assume that a firm uses a nested dictionary to maintain the information on annual sales made...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
Nested dictionary comprehension to output annual sales ... View the full answer
Related Book For
Horngrens Accounting
ISBN: 978-0134674681
12th edition
Authors: Tracie L. Miller nobles, Brenda L. Mattison, Ella Mae Matsumura
Posted Date:
Students also viewed these computer network questions
-
January 1 Number of common shares issued Par value per share Issue price per share March 18 Number of shares purchased Purchase price per share November 11 % of shares resold Resale price per share...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Assume that a firm can produce either Product A, or Product B, or Product C with the resources it currently employs. These resources cost the firm a total of $50 per week. Also assume that the firm...
-
Della Simpson Inc. sells two popular brands of cookies, Dellas Delight and Bonnys Bourbon. Dellas Delight goes through the Mixing and Baking Departments and Bonnys Bourbon, a filled cookie, goes...
-
If the Lorenz curve for the income distribution for a given year is L(x)=xp, use integration to find a simple formula for the corresponding Gini coefficient.
-
Randall Company engaged in activities during the first year of its operations that resulted in the following: service revenue, $4,800; expenses, $2,450; and withdrawals, $410. In addition, the...
-
If the maximum allowable bending stress for the W16 \(\times 50\) structural A992 steel beam is \(\sigma_{\text {allow }}=30 \mathrm{ksi}\), determine the maximum height \(h\) from which a 30-lb...
-
Using 2010 as the base year, prepare a trend analysis of the data that follow, and tell whether the situation shown by the trends is favorable or unfavorable. (Round to one decimalplace.) Net sales...
-
Milo Company manufactures beach umbrellas. The company is preparing detailed budgets for the third quarter and has assembled the following information to assist in the budget preparation: a. The...
-
George Pharmacy is a pharmaceutical salesman who has been very successful at his job in the last few years. Unfortunately, his family life has not been very happy. Three years ago, his only child,...
-
Using the car mileage data from Lab 1, define the following sets: A = {x|x> 125,000), B = {xx < 175,000) and C = {xlx <50,000). Demonstrate the following set equivalencies (DeMorgan's Law) using R...
-
Two oscillatory motions are given by \(x(t)=A \sin (m \omega t)\) and \(y(t)=A \sin (n \omega t+\phi)\), where \(m\) and \(n\) are positive integers. Consider displaying these motions on a single...
-
Write a short commentary on each ledger account prepared in S1, to enable a nonaccountant to understand their purpose and content. Data from S1 Prepare ledger accounts to report the transactions and...
-
A tree that is \(32.6 \mathrm{~m}\) tall leans \(26.0^{\circ}\) from the vertical in the Farth reference frame. How tall is the tree, and at what angle does it lean, in the reference frame of a...
-
By what factor does the inertia of an electron increase (a) as the electron is accelerated from rest to \(\frac{1}{3} c_{0}\) and \((b)\) as its speed is increased by another \(20 \%\) ? (c) Does the...
-
A spacecraft traveling away from Earth at relative speed \(0.850 c_{0}\) sends a radio message when it is \(65,000,000 \mathrm{~km}\) away from Earth in the Earth reference frame. When the signal is...
-
The following information was captured from the general ledger of Cooper General Hospital: Cash Accounts Receivable Supply Inventory Accounts Payable Land Buildings & Equipment less accumulated Wages...
-
Complete problem P10-21 using ASPE. Data from P10-21 Original cost ................................................................. $7,000,000 Accumulated depreciation...
-
What is a bank reconciliation?
-
Explain the difference between static and flexible budgets.
-
Explain the posting process of the sales journal.
-
Show that for two arbitrary random events \(A\) and \(B\) the following inequalities are true: \(P(A \cap B) \leq P(A) \leq P(A \cup B) \leq P(A)+P(B)\).
-
A publishing house offers a new book as standard or luxury edition and with or without a CD. The publisher analyzes the first 1000 orders: Let \(A(B)\) the random event that a book, randomly choosen...
-
Two dice are simultaneously thrown. The result is \(\left(\omega_{1}, \omega_{2} ight)\). What is the probability \(p\) of the event ' \(\omega_{2}=6\) ' on condition that '...
Study smarter with the SolutionInn App