Question: (USE PYTHON) Fill in the code '' Here's the intended outpu of this script, once you fill it in: Welcome to shop1 fruit

(USE PYTHON) Fill in the code

'' " "

Here's the intended outpu 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, fruitShops): """ orderList: List of (fruit, numPound) tuples fruitShops: List of FruitShops """ "*** YOUR CODE HERE ***" return None

if __name__ == '__main__': "This code runs when you invoke the script from the command line" orders = [('apples',1.0), ('oranges',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] print "For orders ", orders, ", the best shop is", shopSmart(orders, shops).getName() orders = [('apples',3.0)] print "For orders: ", orders, ", the best shop is", shopSmart(orders, shops).getName()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!