I was wondering if some situations are not covered by the solution to which shipping method is cheapest.
We are required to use the following syntax:
def cheapest_shipping(weight):
ground = ground_shipping(weight)
premium = premium_ground_shipping
drone = drone_shipping(weight)
if ground < premium and ground < drone:
method = "Ground Shipping"
cost = ground
elif premium < ground and premium < drone:
method = "Premium Ground Shipping"
cost = premium
else:
method = "Drone Shipping"
costs = drone
If any shipping methods are equal, would the arguements fall apart? Iām not sure if I have articulated that well but in the syntax, we only specified if one cost was < another cost, but what happens when one method is equal to another method.
Eg. what if ground_shipping = premium_ground_shipping < drone_shipping
Wouldnāt that return drone shipping as the preferred shipping method because it is covered by the āElseā statement?
Iām sure that this specific scenario doesnāt occur or it might not even be possible to occur in this task but shouldnāt we try to cover all of our bases anyway?