-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1451a28
commit f1ce424
Showing
1 changed file
with
11 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |