finish tutorial tasks
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,5 @@
|
||||
multiagent1/
|
||||
__pycache__/
|
||||
/.vscode
|
||||
/.devcontainer
|
||||
/.github
|
@ -18,6 +18,4 @@ Run python autograder.py
|
||||
|
||||
|
||||
def add(a, b):
|
||||
"Return the sum of a and b"
|
||||
"*** YOUR CODE HERE ***"
|
||||
return 0
|
||||
return a+b
|
@ -35,7 +35,9 @@ def buyLotsOfFruit(orderList):
|
||||
Returns cost of order
|
||||
"""
|
||||
totalCost = 0.0
|
||||
"*** YOUR CODE HERE ***"
|
||||
for item in orderList:
|
||||
fruit, numPounds = item
|
||||
totalCost += fruitPrices[fruit] * numPounds
|
||||
return totalCost
|
||||
|
||||
|
||||
|
@ -30,7 +30,11 @@ def shopSmart(orderList, fruitShops):
|
||||
fruitShops: List of FruitShops
|
||||
"""
|
||||
"*** YOUR CODE HERE ***"
|
||||
return None
|
||||
best_shop=fruitShops[0]
|
||||
for show in fruitShops:
|
||||
if best_shop.getPriceOfOrder(orderList)>show.getPriceOfOrder(orderList):
|
||||
best_shop=show
|
||||
return best_shop
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Reference in New Issue
Block a user