Transportation - oops try again


#1

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

I keep getting this.

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

I even changed -20 to -40 and it still said exactly the same. What am I doing wrong?


#2
def rental_car_cost(days):
    return days * 40
    if days >= 7:
        return days - 50  # the cost is not days - 50
    elif days >= 3 and days <= 6:
        return days - 20 # the cost is not days - 20

For 3 days you return 3 - 20, wich is -17. the actual cost is 3*40 for the 3 days at 40$/day minus the 20 dollar discount.


#3

Got Ya!

made sense in my head for some reason lol. I've included the full calculation and it works now. Thanks.