-
-
Save codecademydev/d8c9095110959b0e6f1652510e5ef32f to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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