diff --git a/2-control-flow/sals-shipping/shipping.py b/2-control-flow/sals-shipping/shipping.py index 07d8cbf..06c4da4 100644 --- a/2-control-flow/sals-shipping/shipping.py +++ b/2-control-flow/sals-shipping/shipping.py @@ -1,36 +1,38 @@ -# Sal's Shipping -# Sonny Li - -weight = 80 - -# Ground Shipping 🚚 - -if weight <= 2: - cost_ground = weight * 1.5 + 20 -elif weight <= 6: - cost_ground = weight * 3.00 + 20 -elif weight <= 10: - cost_ground = weight * 4.00 + 20 -else: - cost_ground = weight * 4.75 + 20 - -print("Ground Shipping $", cost_ground) - -# Ground Shipping Premimum 🚚💨 - -cost_ground_premium = 125.00 - -print("Ground Shipping Premimium $", cost_ground_premium) - -# Drone Shipping 🛸 - -if weight <= 2: - cost_drone = weight * 4.5 -elif weight <= 6: - cost_drone = weight * 9.00 -elif weight <= 10: - cost_drone = weight * 12.00 -else: - cost_drone = weight * 14.25 - -print("Drone Shipping: $", cost_drone) \ No newline at end of file +weight = 41.5 +ground_shiping_premium = 125.00 + +#ground shipping +def ground_shipping(): + if weight <=2: + cost = weight * 1.50 + 20 + return (cost) + elif weight <= 6: + cost = weight * 3.00 + 20 + return (cost) + elif weight <= 10: + cost = weight * 4.00 + 20 + return (cost) + else: + cost = weight * 4.75 + 20.00 + return (cost) + +#Drone shipping +def drone_shipping(): + + if weight <=2: + cost = weight * 4.50 + return (cost) + elif weight <= 6: + cost = weight * 9.00 + return (cost) + elif weight <= 10: + cost = weight * 12.00 + return (cost) + else: + cost = weight * 14.25 + return (cost) + +#Dispaying +print("Your ground shipping cost is: " + str(ground_shipping()) + '$') +print("Your premium shipping cost is: " + str(ground_shiping_premium) +'$') +print("Your drone shipping cost is: " + str(round(drone_shipping(), 1)) + '$')