# 5/7 "Pulling it together" Help

#1

Hi! Regarding exercise 5/7 "Pulling it together"

I was hoping somebody could explain why this works.

``````def hotel_cost(nights):
return 140 * nights
``````
``````def trip_cost(city, days):
return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days)
``````

With regards to using the argument `(days)` within the function `hotel_cost(nights)`.
I donâ€™t understand why this works and does not break the `hotel_cost(nights)` function.

Within the function, `140` is multiplied by the `nights` argument.

If the `nights` argument is changed to `days` , isnâ€™t the function now broken since the value that `140` should be multiplied by, isnâ€™t defined?

Thanks a lot!

#2

`hotel_cost(days)`

what is `days` inside `trip_cost` function? isnâ€™t the value what you passed for `trip_cost` function?

suppose you passed `5` as an argument for `days`.so now `days=5`.itâ€™s working like

`return hotel_cost(5)`

so simply `nights=5`.

so `nights` argument is not changed to `days`.It holds the `days` as value. so

`nights=5` # because days=5

I hope youâ€™ve understand now

#3

Thank you for the response! I believe I get it now.

#4

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