Oops, try again. trip_cost('Los Angeles', 3) raised an error: global name 'nights' is not defined
The program encounters an error, which is weird. Also, I didn't really understand the example. It was:
return 2 * n
return 3 * p
def add(a, b):
return double(a) + triple(b)`
I understand double and triple, but what do a and b have to do with anything?
def hotel_cost(nights): return 140 * nights def plane_ride_cost(city): if city == "Charlotte": return 183 if city == "Tampa": return 220 if city == "Pittsburgh": return 222 if city == "Los Angeles": return 475 def rental_car_cost(days): price = days * 40 if days >= 7: price -= 50 elif days >= 3: price -= 20 return price def trip_cost(city, days): return hotel_cost(nights) + plane_ride_cost(city) + rental_car_cost(days)