-
-
Save codecademydev/7068a75ca2a844dd84e8f2d3d29c3250 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
def ground_ship(weight): | |
if weight<=2 : | |
return 1.5*weight+20 | |
elif 2<weight<=6 : | |
return 3*weight+20 | |
elif 6<weight<=10 : | |
return 4*weight+20 | |
else : return 4.75*weight+20 | |
print(ground_ship(8.4)) | |
premium_ground=125.00 | |
def drone_ship(weight): | |
if weight<=2: | |
return (4.5*weight) | |
elif 2<weight<=6 : | |
return(9*weight) | |
elif 6<weight<=10 : | |
return 12*weight | |
else : return 14.25*weight | |
print(drone_ship(1.5)) | |
def cheaper_ship(weight): | |
if ground_ship(weight)< drone_ship(weight) and ground_ship (weight)< premium_ground : | |
return print("you should ship using ground shipping it will cost" + str ground_ship(weight)) | |
elif drone_ship(weight)< ground_ship (weight) and drone_ship (weight) <preimum_ground : | |
return print ("you should ship using drone shipping it will cost" + str drone_ship(weight)) | |
else : | |
return ("you should ship using premium ground it will cost" + str premium_ground(weight)) | |
print(cheaper_ship(4.8)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment