Plan your Trip. Hi,It's giving an error, Oops, try again. trip_cost should take exactly three parameters: city, days, and spending_money (in that order). Help me


#1

def hotel_cost(days):
    return 140 * days
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=days*40
    if days>=7:
        rent=rent-50
        return rent
    elif days>=3 and days<7:
        rent=rent-20
        return rent
def trip_cost(city,days,spending_money):
    c=plane_ride_cost(city)+rental_car_cost(days)+hotel_cost(days)+spending_money
    return c
    
print trip_cost("Los Angeles",5,600)

#2

nice misleading error message

if i would rent a car for 2 days, rental_car_cost returns none while is should return 80. None + integers wil throw an error

fix your rental_car_cost function


#3

Yeah. It worked! Thank you!


#4