Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created November 12, 2020 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/d8c9095110959b0e6f1652510e5ef32f to your computer and use it in GitHub Desktop.
Save codecademydev/d8c9095110959b0e6f1652510e5ef32f to your computer and use it in GitHub Desktop.
Codecademy export
weight = 41.5
premium_ship = 125.00
def ship_ground(weight):
if (weight <= 2):
return weight*1.50 + 20.00
elif (weight > 2) and (weight <= 6):
return weight*3.00 + 20.00
elif (weight > 6) and (weight <= 10):
return weight*4.00 + 20.00
else:
return weight*4.75 + 20.00
return cost
cost = ship_ground(weight)
print(cost)
def drone_ship(weight):
if (weight <= 2):
return weight*4.50
elif (weight > 2) and (weight <= 6):
return weight*9.00
elif (weight > 6) and (weight <= 10):
return weight*12.00
else:
return weight*14.25
return cost
cost = drone_ship(weight)
print(cost)
if (ship_ground(weight)) > (drone_ship(weight)):
print(" Drone Shipping is the best option. It will cost: " + str(drone_ship(weight) + "."))
elif (ship_ground(weight)) > premium_ship:
print("premium Shipping is the best option. It will cost: " + str(premium_ship) + ".")
elif (ship_ground(weight)) < (drone_ship(weight)):
print ("Ground Shipping is the best option. It will cost: " + "$" + str(ship_ground(weight)) + ".")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment