-
-
Save codecademydev/7c1ac48a8c539037a2d47e1de6133ac2 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
premium_ground_shipping = 125.00 | |
#weight = 8.4 | |
#Ground shipping | |
def ground_cost(weight): | |
if weight <= 2.0: | |
print("Ground shipping: " + str(weight) + "kg costs " + "$" + str(weight * 1.50 + 20.00)) | |
elif weight <= 6: | |
print("Ground shipping: " + str(weight) + "kg costs " + "$"+ str(weight * 3.00 + 20.00)) | |
elif weight <= 10: | |
print("Ground shipping: " + str(weight) + "kg costs " + "$"+ str(weight * 4.00 + 20.00)) | |
elif weight > 10: | |
print("Ground shipping: " + str(weight) + "kg costs " + "$"+ str(weight * 4.75 + 20.00)) | |
#Drone Shipping | |
def drone_cost(weight): | |
if weight <= 2.0: | |
print("Drone shipping: " + str(weight) + "kg costs " + "$"+ str(weight * 4.50)) | |
elif weight <= 6: | |
print("Drone shipping: " + str(weight) + "kg costs " + "$" + str(weight * 9.00)) | |
elif weight <= 10: | |
print("Drone shipping: " + str(weight) + "kg costs " + "$"+ str(weight * 12.00)) | |
elif weight > 10: | |
print("Drone shipping: " + str(weight) + "kg costs " + "$"+ str(weight * 14.25)) | |
#calculate cost of ground shipping based on weight input() | |
ground_cost(41.5) | |
#Ground Shipping Premium flat charge | |
print("Ground Shipping Premium: " + "$" + str(premium_ground_shipping), "flat rate") | |
#calculate cost of drone shipping based on weight input() | |
drone_cost(41.5) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment