SHARE
TWEET

Untitled

a guest Mar 26th, 2020 57 in 174 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def ground_shipping_cost(weight):
  2.   if weight > 10:
  3.     return weight * 4.75 + 20.00
  4.   elif weight > 6 and weight <= 10:
  5.     return weight * 4.00 + 20.00
  6.   elif weight > 2 and weight <= 6:
  7.     return weight * 3.00 + 20.00
  8.   elif weight <= 2:
  9.     return weight * 1.50 + 20.00
  10.  
  11. def drone_shipping_cost(weight):
  12.   if weight > 10:
  13.     return weight * 14.25
  14.   elif weight > 6 and weight <= 10:
  15.     return weight * 12.00
  16.   elif weight > 2 and weight <= 6:
  17.     return weight * 9.00
  18.   elif weight <= 2:
  19.     return weight * 4.50
  20.  
  21. premium_ground_shipping = 125.00
  22.  
  23. def best_shipping_option(weight):
  24.   premium = premium_ground_shipping
  25.   ground = ground_shipping_cost(weight)
  26.   drone = drone_shipping_cost(weight)
  27.  
  28.   if ground < drone and ground < premium:
  29.     return "Ground shipping is the cheapest and will cost you $" + str(ground)
  30.   elif drone < ground and drone < premium:
  31.     return "Drone shipping is the cheapest option and will cost you $" + str(drone)
  32.   elif premium < ground and premium < drone:
  33.     return "Premium shipping the cheapest option and will cost you $" + str(premium)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top