subject

In a dictionary whose keys are the warehouses: associated with each warehouse is an inner dictionary whose keys are the stocked products (and whose associated values are the inventory of that product in the warehouse). the inventory must always be a non-negative value; an inventory of 0 is legal. for example, a simple/small database might be.

db = {'irvine' : {'brush': 3, 'comb': 2, 'wallet': 2}, 'newport': {'comb': 7, 'stapler': 0},
'tustin' : {'keychain': 3, 'pencil': 4, 'wallet': 3}}

this data structure means that

the irvine warehouse stocks 3 brushes, 2 combs, and 2 wallets.

the newport warehouse stocks 7 combs, and 0 staplers.

the tustin warehouse stocks 3 keychains, 4 pencils, and 3 wallets.

(c) the by_store_inventory2 function returns a list of 2-tuples (str, int) (warehouse names and inventory), sorted ascending by which warehouses have the largest inventory (summed over all the products). if two warehouses store the same inventory, they should appear in ascending order of warehouse name: for the db dictionary above the result is [('irvine', 7), ('newport', 7), ('tustin', 10)].

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Businesses allocate resources for their best and most productive uses. the more a resource, the more costly it will be. a manufacturer that requires scarce and costly resources is likely to charge for its products.
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
Ihave an iphone 8plus should i get another phone like samsung note 9 or s9 ? ?
Answers: 2
question
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
question
Computers and Technology, 23.06.2019 22:50
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
You know the right answer?
In a dictionary whose keys are the warehouses: associated with each warehouse is an inner dictionar...
Questions
question
English, 22.12.2019 02:31
question
Mathematics, 22.12.2019 02:31
question
Mathematics, 22.12.2019 02:31
question
Mathematics, 22.12.2019 02:31
Questions on the website: 13722363