4. Transportation


#1




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


i don't understand why i am getting that error message.

Replace this line with your code. 
def hotel_cost(nights):
    return 140*nights
def plane_ride_cost(city):
    if city=="Charlotte":
        return 183
    elif city=="Tampa":
        return 220
    elif city=="Pittsburgh":
        return 222
    elif city=="Los Angeles":
        return 475
def rental_car_cost(days):
    return days*40
    if days >= 7:
        cost -= 50
    elif days >= 3:
        cost -= 20
    elif days >7 and days >=3 :
        return "you cannot get both of the above discounts"
    return cost


#2

a function ends the moment a return keyword is reached, in other words here:`

return days*40

i recommend to declare cost on this line. (days * 40)


#3

A return statement immediately terminates execution of a function, and returns a value. What effect does this have on the execution of your rental_car_cost function?


#4

thank you so much! After being stuck for a day, it has finally worked.


#5