Pull it Together
Oops, try again. Make sure to define a function named trip_cost.
I dont know what's wrong. I saw another way to do it by create a variable and add them up. a= b= c=
return a + b + c. which makes sense but i was wondering if my way is correct too if not why and also why it saying that i not defining my function. Thanks in advance.
Replace this line with your code. def hotel_cost(nights): return 140*nights # getting there 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 # Transportaion def rental_car_cost(days): CostofCar = 40 * days if days >= 7: CostofCar -= 50 elif days >=3: CostofCar -= 20 return CostofCar # adding all cost together def trip_cost(city,days): return rental_car_cost(days) + hotel_cost(days) +plane_ride_cost(city)