Hello everyone. This is my first post to the forums so please forgive me if I forgot something. I am currently working on Sal’s Shipping Project and everything was fine until running the final function. The problem I am having is that when I enter 4.5 as the argument I get “NONE”, but when I enter 41.5, the function works and says that Premium is the method and gives the cost. I’ve been working on this for the last 2 hours and just cannot seem to get this to work, even when trying the solution in the video provided. I’m hoping someone can take a look and tell me where I went wrong.
def ground_shipping_cost(weight): if weight <= 2.0: return weight * 1.50 + 20 elif weight <= 6.0: return weight * 3.00 + 20 elif weight <= 10.0: return weight * 4.00 + 20 else: return weight * 4.75 + 20 print(ground_shipping_cost(8.4)) premium_ground_shipping = 125 def drone_shipping_cost(weight): if weight <= 2.0: return weight * 4.50 elif weight <= 6.0: return weight * 9.00 elif weight <= 10.0: return weight * 12.00 else: return weight * 14.25 print(drone_shipping_cost(1.5)) def cheapest_shipping(weight): ground = ground_shipping_cost(weight) drone = drone_shipping_cost(weight) premium = premium_ground_shipping if ground < drone and ground < premium: method = "Ground shipping" cost = ground elif drone < ground and drone < premium: method = "Drone shipping" cost = drone else: method = "Premium shipping" cost = premium print("The cheapest method will be " + str(method) + " and it will cost $" + str(cost) + ".") print(cheapest_shipping(41.5))