4. Transportation


#1



https://www.codecademy.com/courses/python-beginner-P5YtY/1/3?curriculum_id=4f89dab3d788890003000096#


Oops, try again. It looks like rental_car_cost returns 90 instead of the correct amount (40) for 1 days.


it should return 40 with my code:

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


#2

You are using same variable days for saving the rental_cost?
You will have some weird results if you do that,
so instead days = 40 * days use some other variable like..

rental = 40 * days

Discount means that You have to pay less, right?
But you're adding 50 or 20 ,
like one of the place you did this..

days += 50


#3

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