Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created January 19, 2021 17:47
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/7c1ac48a8c539037a2d47e1de6133ac2 to your computer and use it in GitHub Desktop.
Save codecademydev/7c1ac48a8c539037a2d47e1de6133ac2 to your computer and use it in GitHub Desktop.
Codecademy export
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