Car rental not working?


#1
def rental_car_cost(days):
price = 40 * days
if days >= 7:
    price - 50
elif days >= 3:
    price - 20
return price

Oops, try again. It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days.


#2

**SELF SOLVED! :smile: **


#3

I have the same problem, but I don't know how to solve it
Please help?


#4

What you have to do is put the price = price - the amount reduced:

def rental_car_cost(days):
cost = days * 40
if days >= 7:
cost = cost - 50
elif days >= 3:
cost = cost - 20
return cost