Taking a vacation


#1

I dont understand where is my mistake:

this is my code so far

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):
rental = 40 * days
if days >= 7:
rental += (-50)
elif days >= 3 and days < 7:
rental += (-20)
return rental

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

Oops, try again. trip_cost('Charlotte', 9) returned 1880 instead of the correct value 1753


#2

Hi @neriyah,

You have called rental_car_cost twice here, and have not called plane_ride_cost. ...

    return rental_car_cost(days) + rental_car_cost(days) + hotel_cost(days)

#3

you are right

Thanks and sorry for that


#4

No problem; no need to be sorry. :smile:


#5