Question: Please write in Python and note restrictions / guidelines thank you. Restrictions Allowed Things: - The, ( + + = ) , and
Please write in Python and note restrictionsguidelines thank you.
Restrictions
Allowed Things:
The, and all numeric operators
in operator
break and continue
str int float range len append and index functions
Disallowed Things:
import anything.
list slicing.
string formatting or string indexing stringindex or the list function.
inputfunction
lambda expressions, dictionaries or any other Python features not covered in class
Review the restriction section for each function to determine if any additional limitations or requirements need to be applied to that specific function. Tasks
Your startup company is developing a new system for autonomous grocery inventory management. You are creating software that allows both human operators and AI systems to control robots responsible for moving inventory items. To begin, you develop a proof of concept POC: a simple system to manage the inventory in a single row. The row is represented by a list of items.
To achieve this, you need to implement five distinct functions described below. Each function is worth points. def calculateinventoryvalueinventory pricelist:
Description: This function accepts the current inventory list including itemsproducts and their quantities and a list of itemsproducts with their prices. It calculates and returns the total retail value of the inventory.
Parameters:
inventory a list of strings and integers reflects the current items and their quantities in the inventory.
itemist a list of strings and floats indicates the list of items and their prices.
Assumptions: There are no duplicate items in any of the input lists. The inventory or priceist may be empty. If an item's name is not found in the pricelist, its price should be assumed to be
Return value: a floatingpoint number representing the total retail value of the inventory. Examples:
inventory Apple 'Pineapple', 'Orange',
pricelist Apple 'Orange', 'Pineapple', 'Bread',
calculateinventoryvalueinventory pricelistboldsymbolmathbf
# Explanation: We have apples, pineapples, and oranges in the inventory, each costing and dollars respectively. Therefore, the total value of the current inventory is dollars.
inventory Apple 'Pineapple', 'Orange', 'Bread',
pricelist Apple 'Orange', 'Bread', 'Grapes',
calculateinventoryvalueinventory pricelist
# Explanation: We have apples, pineapples, oranges, and breads in the inventory, each costing and dollars respectively. Therefore, the total value of the current inventory is dollars.
inventory
pricelist Grapes 'Diaper', 'Bread', 'Onion',
calculateinventoryvalueinventory pricelist
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
