subject

Use paython basic for two question: 1) Fill in the function shopSmart(orders, shops) in shopSmart. py, which takes an orderList (like the kind passed in to FruitShop. getPriceOfOrder) and a list of FruitShop and returns the FruitShop where your order costs the least amount in total. Don't change the file name or variable names, please. Note that we will provide the shop. py implementation as a "support" file, so you don't need to submit yours.
For example, with the following variable definitions:
orders1 = [('apples',1.0), ('oranges',3.0)]
orders2 = [('apples',3.0)]
dir1 = {'apples': 2.0, 'oranges':1.0}
shop1 = shop. FruitShop('shop1',dir1)
dir2 = {'apples': 1.0, 'oranges': 5.0}
shop2 = shop. FruitShop('shop2',dir2)
shops = [shop1, shop2]
shopSmart. shopSmart(orders1, shops) == shop1
and
shopSmart. shopSmart(orders2, shops) == shop2
shop Smart .py Heres the intended output of this script, once you fill it in: Welcome to shop1 fruit shop Welcome to shop2 fruit shop For orders apples 1.0) oranges 3.0) best shop is shop1 For orders apples 3.0) best shop is shop2 import shop def shopSmart (orderList ruit Shops) order List List of (fruit, numPound) tuples fruit Shops List of Fruit Shops YOUR CODE HERE return None problem data orders apples 1.0) oranges 3.0 j dir1 apples 2.0, oranges 1.0) shop1 hop Fruit Shop shop1 dir1) dir2 apples 1.0, oranges 5.0) op2 hop Fruit Shop shop 2 dir2) shops [sh shop2 op j
2) Add a buyLotsOfFruit(orderList) function to buyLotsOfFruit. py which takes a list of (fruit, pound) tuples and returns the cost of your list. If there is some fruit in the list which doesn't appear in fruitPrices it should print an error message and return None.
DO NOT change the fruitPrices variable.
For example,
Cost of [('apples', 2.0), ('pears', 3.0), ('limes', 4.0)] is 12.25

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:20
Octothorpe is another name for what common computer keyboard symbol?
Answers: 1
question
Computers and Technology, 23.06.2019 18:40
Johnson enterprises uses a computer to handle its sales invoices. lately, business has been so good that it takes an extra 3 hours per night, plus every third saturday, to keep up with the volume of sales invoices. management is considering updating its computer with a faster model that would eliminate all of the overtime processing.
Answers: 2
question
Computers and Technology, 24.06.2019 13:50
What does code do? a creates a text box that says "solid black" b creates a black border of any width c creates a black border 1 pixel wide
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
Text or graphics that print at the bottom of every page are called footings footers headers headings
Answers: 1
You know the right answer?
Use paython basic for two question: 1) Fill in the function shopSmart(orders, shops) in shopSmart....
Questions
question
Social Studies, 15.04.2021 01:20