Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created December 25, 2020 07:58
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/d0386ee55dce17a1e941ff66a38822ab to your computer and use it in GitHub Desktop.
Save codecademydev/d0386ee55dce17a1e941ff66a38822ab to your computer and use it in GitHub Desktop.
Codecademy export
#4rd try
premium = 125.00
def ground_ship(weight):
if weight <=2:
price = 1.5
elif 2 < weight <= 6:
price = 3
elif 6 < weight <= 10:
price = 4
else:
price = 4.75
return print(20 + (price * weight))
def drone_ship(weight):
if weight <=2:
price = 4.5
elif 2 < weight <= 6:
price = 9
elif 6 < weight <= 10:
price = 12
else:
price = 14.25
return print(price * weight)
def best_price(weight):
ground = ground_ship(weight)
drone = drone_ship(weight)
if ground < drone and ground < premium:
print("ground is cheap" + ground)
elif drone < ground and drone < premo:
print("drone is cheap" + drone)
else:
return print("you need premium")
best_price(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment