Answered step by step
Verified Expert Solution
Question
1 Approved Answer
def analysis(self, inventory): Computes two descriptive statistics of the inventory amounts associates with each key in the inventory dictionary. Creates a new dictionary that
def analysis(self, inventory): |
""" |
Computes two descriptive statistics of the inventory amounts associates |
with each key in the inventory dictionary. Creates a new dictionary |
that has the same keys as inventory, but the values are tuples with |
min, max, total, and average information. |
inventory: dictionary of items with the following keys and values |
key: alphabetic string, type of item |
value: list of non-negative integers, amounts on inventory for |
a particular type of item |
Returns: new dictionary |
key: alhpabetic string, same as the key in inventory |
value: tuple of four elements, corresponding to: |
min, max, total, and average of inventory amounts. |
Exammple |
analysis({'table': [70, 90, 100], 'chair': [75, 95]}) returns |
{'table': (70, 100, 260, 86.6), 'chair': (75, 95, 170, 85.0)} |
"""
Assistance please. No idea where to start. Language is Python.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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