Pull it together!


#1

New problem! Please help me!
Oops, try again. plane_ride_cost('Pittsburgh') returned 'Enter city' instead of the correct value 222

def hotel_cost(nights):
    return 140 * nights

def plane_ride_cost(city):
    if city == "Charlotte":
        return 183
   
    elif city == "Tampa":
        return 220
    
    elif city == "Pittsburg":
        return 222
    
    elif city == "Los Angeles":
        return 475
    
    return "Enter city"


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

def trip_cost(city, days):
    return hotel_cost(days) + rental_car_cost(days) + plane_ride_cost(city)


#2

Check the spelling in your plane_ride_cost function.


#3

Thank you so much!

cheers!


#4

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