文件名称:task
下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
介绍说明--下载内容均来自于网络,请自行研究使用
Python入门练习,Question 2: buyLotsOfFruit function
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. Please do not change the fruitPrices variable.
Run python autograder.py until question 2 passes all tests and you get full marks. Each test will confirm that buyLotsOfFruit(orderList) returns the correct answer given various possible inputs. For example, test_cases/q2/food_price1.test tests whether:
Cost of [( apples , 2.0), ( pears , 3.0), ( limes , 4.0)] is 12.25
-MACHINE LEARNING Assignment0 Shop
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. Please do not change the fruitPrices variable.
Run python autograder.py until question 2 passes all tests and you get full marks. Each test will confirm that buyLotsOfFruit(orderList) returns the correct answer given various possible inputs. For example, test_cases/q2/food_price1.test tests whether:
Cost of [( apples , 2.0), ( pears , 3.0), ( limes , 4.0)] is 12.25
-MACHINE LEARNING Assignment0 Shop
(系统自动生成,下载前可以参看下载内容)
下载文件列表
task
....\.DS_Store
__MACOSX
........\task
........\....\._.DS_Store
task\addition.py
__MACOSX\task\._addition.py
task\addition.pyc
__MACOSX\task\._addition.pyc
task\autograder.py
__MACOSX\task\._autograder.py
task\buyLotsOfFruit.py
__MACOSX\task\._buyLotsOfFruit.py
task\buyLotsOfFruit.pyc
__MACOSX\task\._buyLotsOfFruit.pyc
task\grading.py
__MACOSX\task\._grading.py
task\grading.pyc
__MACOSX\task\._grading.pyc
task\projectParams.py
__MACOSX\task\._projectParams.py
task\projectParams.pyc
__MACOSX\task\._projectParams.pyc
task\shop.py
__MACOSX\task\._shop.py
task\shop.pyc
__MACOSX\task\._shop.pyc
task\shopSmart.py
__MACOSX\task\._shopSmart.py
task\shopSmart.pyc
__MACOSX\task\._shopSmart.pyc
task\test_cases
....\..........\CONFIG
__MACOSX\task\test_cases
........\....\..........\._CONFIG
task\test_cases\q1
....\..........\..\addition1.solution
__MACOSX\task\test_cases\q1
........\....\..........\..\._addition1.solution
task\test_cases\q1\addition1.test
__MACOSX\task\test_cases\q1\._addition1.test
task\test_cases\q1\addition2.solution
__MACOSX\task\test_cases\q1\._addition2.solution
task\test_cases\q1\addition2.test
__MACOSX\task\test_cases\q1\._addition2.test
task\test_cases\q1\addition3.solution
__MACOSX\task\test_cases\q1\._addition3.solution
task\test_cases\q1\addition3.test
__MACOSX\task\test_cases\q1\._addition3.test
task\test_cases\q1\CONFIG
__MACOSX\task\test_cases\q1\._CONFIG
........\....\..........\._q1
task\test_cases\q2
....\..........\..\CONFIG
__MACOSX\task\test_cases\q2
........\....\..........\..\._CONFIG
task\test_cases\q2\food_price1.solution
__MACOSX\task\test_cases\q2\._food_price1.solution
task\test_cases\q2\food_price1.test
__MACOSX\task\test_cases\q2\._food_price1.test
task\test_cases\q2\food_price2.solution
__MACOSX\task\test_cases\q2\._food_price2.solution
task\test_cases\q2\food_price2.test
__MACOSX\task\test_cases\q2\._food_price2.test
task\test_cases\q2\food_price3.solution
__MACOSX\task\test_cases\q2\._food_price3.solution
task\test_cases\q2\food_price3.test
__MACOSX\task\test_cases\q2\._food_price3.test
........\....\..........\._q2
task\test_cases\q3
....\..........\..\CONFIG
__MACOSX\task\test_cases\q3
........\....\..........\..\._CONFIG
task\test_cases\q3\select_shop1.solution
__MACOSX\task\test_cases\q3\._select_shop1.solution
task\test_cases\q3\select_shop1.test
__MACOSX\task\test_cases\q3\._select_shop1.test
task\test_cases\q3\select_shop2.solution
__MACOSX\task\test_cases\q3\._select_shop2.solution
task\test_cases\q3\select_shop2.test
__MACOSX\task\test_cases\q3\._select_shop2.test
task\test_cases\q3\select_shop3.solution
__MACOSX\task\test_cases\q3\._select_shop3.solution
task\test_cases\q3\select_shop3.test
__MACOSX\task\test_cases\q3\._select_shop3.test
........\....\..........\._q3
........\....\._test_cases
task\testClasses.py
__MACOSX\task\._testClasses.py
task\testClasses.pyc
__MACOSX\task\._testClasses.pyc
task\testParser.py
__MACOSX\task\._testParser.py
task\testParser.pyc
__MACOSX\task\._testParser.pyc
task\tutorialTestClasses.py
__MACOSX\task\._tutorialTestClasses.py
task\tutorialTestClasses.pyc
__MACOSX\task\._tutorialTestClasses.pyc
task\util.py