codecademy says that the following code is correct, but if you were actually going on a vacation you would spend EXACTLY 1 NIGHT LESS ON VACATION THAN THE NUMBER OF DAYS ON VACATION. codecademy says that you should sum hotel_cost(days) with everything else, BUT THAT IS COMPLETELY INCORRECT AS IT SHOULD INSTEAD SUM hotel_cost(days - 1) INSTEAD. If you went on a 1 day vacation, you would NOT spend 1 night. If you spent 1 night, you would have to spend 2 days, the one before that night, and the one after that night. Similarly, if you spend 5 days on vacation, you would only rent the hotel for 4 nights. Whoever thinks that you should rent the same number of nights as you have days is going to END UP WASTING GOOD MONEY PAID FOR BY HOURS OF STULTIFYING LABOR because they will have booked either the night BEFORE they leave for their vacation or the night AFTER they have finished their vacation.
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): if days >= 7: return 40*days - 50 elif days >= 3: return 40*days - 20 else: return 40*days def trip_cost(city, days): return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days)