Taking a Vacation: Rental Car


#1

I am stuck, what do i do?

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

#2

Hi @thyler

You should probably place this under the python area of the discussion forums. In addition, a link to the lesson in question would be nice as well. However, what's your error?


#3

I believe I've moved it to the correct place :slight_smile:


#4

all you need to do is actually return it if it is not greater than 7 or 3 days


#5

"""You can create a variable discount like this..."""

def rental_car_cost(days):

cost_per_day = 40
total_cost = cost_per_day * days
discount = False

if days >= 7:
    total_cost = total_cost - 50
    discount = True
elif days >= 3 and discount != True:
    total_cost = total_cost - 20

return total_cost

#7