From 60449b87ca6252432cf674c281c7f58e5cf4ca94 Mon Sep 17 00:00:00 2001 From: onefloid <33193059+onefloid@users.noreply.github.com> Date: Sun, 3 Mar 2024 14:12:21 +0100 Subject: [PATCH] Feature: Determine cheapest shipping method --- 2-control-flow/sals-shipping/shipping.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/2-control-flow/sals-shipping/shipping.py b/2-control-flow/sals-shipping/shipping.py index 07d8cbf..9b6e4b9 100644 --- a/2-control-flow/sals-shipping/shipping.py +++ b/2-control-flow/sals-shipping/shipping.py @@ -33,4 +33,13 @@ else: cost_drone = weight * 14.25 -print("Drone Shipping: $", cost_drone) \ No newline at end of file +print("Drone Shipping: $", cost_drone) + +# Determine cheapest shipping method + +if cost_ground < cost_ground_premium and cost_ground < cost_drone: + print("Ground Shipping is the cheapest: $", cost_ground) +elif cost_ground_premium < cost_ground and cost_ground_premium < cost_drone: + print("Ground Shipping Premium is the cheapest: $", cost_ground_premium) +else: + print("Drone Shipping is the cheapest: $", cost_drone) \ No newline at end of file