Transportation


#1



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 40*days
    if days >=7:
        return -50   
    elif days >= 3:
        return -20


#2

a function ends the moment a return keyword is reached, so your function ends here:

return 40*days

it never gets to the apply discount.

then here:

return -50

this will just return -50, it should return 40 * days -50 (applying discount on total cost)


#3

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

this is what i understood from what you were saying yet it still doesn't work for me?


#5

never mind this seemed to work for me
def rental_car_cost(days):
if days >=7:
return 40*days-50
elif days >= 3:
return 40*days-20
elif days < 3:
return days*40


#6