# Hey, You Never Know!

#1

Error message states: "Oops, try again. trip_cost('Los Angeles', 2, 75) returned 985 instead of the correct value 910". I honestly do not know where I made a mistake. Any help is appreciated!

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):
total = 40 * days
if days >= 7:
elif days >= 3:

def trip_cost(city,days,spending_money):
nights = days
spending_money *= days
return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spending_money

#2

You have this ...

spending_money *= days

... but the argument passed as spending_money represents the total amount of spending money for the trip, rather than the amount for each day. Therefore you should not multiply it by the number of days of the trip.

#3

Both of these lines can be removed.

#4

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