It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days


#1



Taking a Vacation - Transportation

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


I dont get it,it looks like a fine code to me.


def hotel_cost(nights):
    # 140$ per night
    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):
    rent = 40 * days
    return rent
    if days >= 7:
        rent -= 50
        return rent
    elif days <= 3 and days >= 6:
        rent -= 20
        return rent


#2

a function ends the moment a return keyword is reached, so your function ends prematurely, it never reaches the discount lines


#3

Thank you! Wow I spend like an hour and didnt even think of it...


#4