Transportation


#1



https://www.codecademy.com/courses/python-beginner-P5YtY/1/3


I got the error message, "It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days." I can't see how this is the problem, and I expect this to let 'days' get 50 dollars off if it's greater than or equal to 7. I also want it to give days 30 dollars off if it's greater than or equal to 3.

Here's the code:


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


#2

Store this value in a variable...

cost = days * 40

Do not modify the argument. Adjust cost.

Return cost.


#3

Thanks but one more thing.

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

This gives me, "It looks like rental_car_cost returns 90 instead of the correct amount (40) for 1 days." I'm not really sure what happened here.


#4

minus 50, and minus 20. It's supposed to be a discount.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.