Please format your post as I have done (select entire code block; press Ctrl+Shift+C) from next time. Thanks!
Read the instructions very carefully.
- Every day you rent the car costs $40.
- if you rent the car for 7 or more days, you get $50 off your total.
- Alternatively (elif), if you rent the car for 3 or more days, you get $20 off your total.
- You cannot get both of the above discounts.
Now, see that you are doing
40*7-50 for the
if clause. But, the rate for each day is 40. And you already have the number of
days the user has traveled. And, you know that
cost = rate * quantity or
cost = rate * number. And you have to
cost - discount. Getting my point? Know what error you are making? Can you now fix the error in this
Also, note that in the
else clause, you only have to
cost, since discount is zero.