From the Pull it Together exercise instructions ...
Below your existing code, define a function called
trip_cost that takes two arguments,
days parameters should be in the order given above. There should be no
The Hey, You Never Know! exercise instructions include this ...
trip_cost function definition. Add a third argument,
Then your function header should be ...
def trip_cost(city, days, spending_money):
The order of the parameters is important. Codecademy's test requires them to be in that order.
Within the function, you have ...
return rental_car_cost(days) + plane_ride_cost(city) + spending_money + hotel_cost(nights)
However, the Pull it Together exercise instructions point out that ...
It is completely valid to call the
hotel_cost(nights) function with the variable
We do not have a variable,
nights, defined within the
trip_cost function, however our variable,
days, has the same value as the number of nights of the hotel stay. Therefore, inside the function, you should instead have ...
return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money