Question
Example: Function call: shipping_cost([Package(Monmouth, Appleby, cost=0, distance=144), Package(Larkinge, Ballachulish, cost=0, distance=65), Package(Malrton, Auchtermuchty, cost=0, distance=872), Package(Monmouth, Anghor Thom, cost=0, distance=937)], [10, 16, 37, 49])} Return
Example: Function call: shipping_cost([Package("Monmouth", "Appleby", cost=0, distance=144), Package("Larkinge", "Ballachulish", cost=0, distance=65), Package("Malrton", "Auchtermuchty", cost=0, distance=872), Package("Monmouth", "Anghor Thom", cost=0, distance=937)], [10, 16, 37, 49])}
Return value: 124
Updated packages list:
[Package("Monmouth", "Appleby", cost=16, distance=144), Package("Larkinge", "Ballachulish", cost=10, distance=65), Package("Malrton", "Auchtermuchty", cost=49, distance=872), Package("Monmouth", "Anghor Thom", cost=49, distance=937)]
Part I: Shipping Packages (20 points) Complete the function shipping.cost (),which takes two arguments, in this order: I. packages: a list of Package objects for which we need to compute the costs to ship. 2. cost.schedule: a list of 4 integers that represent how much it costs to ship a package various distances: Meaning cost.schedule [0] the cost to ship a packageStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started