From f1ce42434cd6a0f41c89c73b1199f6a7c1334e83 Mon Sep 17 00:00:00 2001 From: Aidan Baird <102356055+AidanBaird@users.noreply.github.com> Date: Fri, 19 Aug 2022 01:01:27 +0100 Subject: [PATCH] Add files via upload --- Transportation_on_vacation_kyu8.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Transportation_on_vacation_kyu8.py diff --git a/Transportation_on_vacation_kyu8.py b/Transportation_on_vacation_kyu8.py new file mode 100644 index 0000000..b6edb40 --- /dev/null +++ b/Transportation_on_vacation_kyu8.py @@ -0,0 +1,11 @@ +# Work out the price of a rental car that costs £40 a day, you get 20 off if you hire for three or more days and 50 off if you hire for 7 or more +# Find the overall cost without reductions by timsing days by 40 +# Subtract reductions based on length of days + +def rental_car_cost(d): + cost = (d * 40) + if d >= 3: + cost -= 20 + if d >= 7: + cost -= 30 + return cost \ No newline at end of file